Para poder poner color a la letras y fondo del programa se debe importar colorama, además de lo que se indica en el código.
- Código:
from colorama import init, Fore, Back, Style, Cursor
init()
x = True
y = False
# output: x and y is false
print(Style.BRIGHT+Fore.RED+'x and y is',x and y)
# Output: x or y is True
print(Style.DIM+Back.WHITE+'X OR Y IN',x or y)
# Output: not x is False
print(Style.NORMAL+Fore.WHITE+Back.BLUE+'not x is',not x)
# BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE
# Style.RESET_ALL
# BACK(15), UP(1), FORWARD(10), DOWN()
# Cursor.FORWAR(7)+
- Ejecución:
No hay comentarios:
Publicar un comentario