Poner color al texto y al fondo

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

Ultima entrada ingresada

SISTEMA DE RIEGO AUTOMÁTICO CON MÚSICA

El objetivo era hacer un programa que pueda activar una bomba de agua en la noche, y que por las mañanas reproduzca música para las plantas....