Skip to main content

Un paquete para imprimir texto de colores en la terminal de Windows

Project description

░██████╗░██╗██╗░░░██╗███████╗░█████╗░░█████╗░██╗░░░░░░█████╗░██████╗░
██╔════╝░██║██║░░░██║██╔════╝██╔══██╗██╔══██╗██║░░░░░██╔══██╗██╔══██╗
██║░░██╗░██║╚██╗░██╔╝█████╗░░██║░░╚═╝██║░░██║██║░░░░░██║░░██║██████╔╝
██║░░╚██╗██║░╚████╔╝░██╔══╝░░██║░░██╗██║░░██║██║░░░░░██║░░██║██╔══██╗
╚██████╔╝██║░░╚██╔╝░░███████╗╚█████╔╝╚█████╔╝███████╗╚█████╔╝██║░░██║
░╚═════╝░╚═╝░░░╚═╝░░░╚══════╝░╚════╝░░╚════╝░╚══════╝░╚════╝░╚═╝░░╚═╝

@author: 𓂀 𝒥-𝒳𝒶𝓃𝒹𝑒𝓇 𓂀
@version: 0.1.6
@since: 2024/09/27 @date: 2024/10/7

Imprime texto de colores y con estilos en la terminal

Funcionalidad

Sobreescribe la funcion interna print y añade nuevos parametro:

  • fore: Recibe un identificador ansi para establecer el color del texto
  • back: Recibe un identificador ansi para establecer un color de fondo el texto.
  • style: Recibe un identificador ansi para establece un stylo en el texto.

Nota: Puede recibir tanto como un numero como una cadena o la secuencia de escape directa.

EJEMPLO DE USO

    import givecolor

    print('Texto en rojo y fondo blanco', fore='red', back='white')
    print('Texto en rojo y fondo blanco', fore=31, back=47)

Podemos importar algunas clases Enum perteneciente a la libreria para poder optener una lista de todos los colores y stylos disponibles

  • Fore: Enumera los colores de texto disponibles.
  • Back: Enumera los colores de fondo disponibles.
  • Style: Enumero los stylos disponibles que podemos darle al texto.

Nota: Hay varios estilos que no estan añadidos ya que no soportados por ciertas terminales.

EJEMPLO DE USO

    from givecolor import Fore, Back, Style

    print('Texto en verde y tachado con fondo azul',
            fore=Fore.GREEN,
            back=Back.BLUE,
            style=Style.CROSSED)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

givecolor-0.1.6.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

givecolor-0.1.6-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file givecolor-0.1.6.tar.gz.

File metadata

  • Download URL: givecolor-0.1.6.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for givecolor-0.1.6.tar.gz
Algorithm Hash digest
SHA256 334423fb9a9e39bb806aa3117eb1dbc2b4cfd9e27781dc2bb5bc0b4707722aab
MD5 711e29a3606c7f22a9150279f04b392b
BLAKE2b-256 5b64936bbd53dbc9ca41654dfd69c13db195d53b8c36bcf9314fa3b833ff4d8d

See more details on using hashes here.

File details

Details for the file givecolor-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: givecolor-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for givecolor-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 64094a5733b9d5cc037c29cb5b19840d51ef9492746eda5702b6472d22f542d4
MD5 fe840ba69d65e53b9a055360712dd5b2
BLAKE2b-256 0acb71cd009c66a1de9836127fb23001d6005d4cf23f12a6fedb7ec915a9d0fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page