Saltar al contenido

ejemplo de código colorama

La guía o código que verás en este artículo es la solución más fácil y efectiva que encontramos a esta duda o problema.

Ejemplo 1: colorama

from colorama import Fore, Back, Style
print(Fore.RED + 'some red text')
print(Back.GREEN + 'and with a green background')
print(Style.DIM + 'and in dim text')
print(Style.RESET_ALL)
print('back to normal now')

Ejemplo 2: colorama

# Source:#         https://www.youtube.com/watch?v=u51Zjlnui4Y#         https://github.com/techwithtim/ColoredTextInPythonimport colorama
from colorama import Fore, Back, Style
colorama.init(autoreset=True)

print('33[31m' + 'some red text')
print('33[39m')# and reset to default color
print()
print(f"Fore.REDCFore.GREENOFore.YELLOWLFore.BLUEOFore.MAGENTARFore.CYANSFore.WHITE!")
print(f"Fore.REDRed Text")
print(f"Fore.GREENGreen Text")
print(f"Fore.YELLOWYellow Text")
print(f"Fore.BLUEBlue Text")
print(f"Fore.MAGENTAMagenta Text")
print(f"Fore.CYANCyan Text")
print(f"Fore.WHITEWhite Text")
print()
print(f"Back.REDBBack.GREENABack.YELLOWCBack.BLUEKBack.MAGENTAGBack.CYANRBack.WHITEOBack.REDUBack.GREENNBack.YELLOWDBack.BLUE!")
print(f"Back.REDRed Background")
print(f"Back.GREENGreen Background")
print(f"Back.YELLOWYellow Background")
print(f"Back.BLUEBlue Background")
print(f"Back.MAGENTAMagenta Background")
print(f"Back.CYANCyan Background")
print(f"Back.WHITEWhite Background")
print()
print(f"Style.DIMSStyle.NORMALTStyle.BRIGHTYStyle.DIMLStyle.NORMALEStyle.BRIGHT!")
print(f"Style.DIMDim Text")
print(f"Style.NORMALNormal Text")
print(f"Style.BRIGHTBright Text")
print()
print(f"Fore.YELLOWBack.REDCBack.GREENFore.REDOBack.YELLOWFore.BLUEMBack.BLUEFore.BLACKBBack.MAGENTAFore.CYANIBack.CYANFore.GREENNBack.WHITEABack.REDTBack.GREENIBack.YELLOWOBack.BLUEN")
print(f"Fore.GREENBack.YELLOWStyle.BRIGHTGreen Text - Yellow Background - Bright")
print(f"Fore.CYANBack.WHITEStyle.DIMCyan Text - White Background - Dim")'''
Fore: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET.
Back: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET.
Style: DIM, NORMAL, BRIGHT, RESET_ALL
'''

Ejemplo 3: desde colorama import Fore, Back, Style ImportError: Ningún módulo llamado colorama

Hack the box - buff 

Guys, this problem took me 1 day to find the problem and the issue is the
script needs python 2.7 and is missing libraries.
You'll need to install them.

Open terminal:
Install Python 2.7sudoapt-getinstall python-pip

Install pip
sudo pip install requests

Install colorama
sudo pip install colorama

Run exploit:
python exploitname.py url

Happy Hacking!

Ejemplo 4: cómo instalar colorama

Installing with pip is almost always the way to go. 
It will handle downloading the package for you, as well as any dependencies. 
If you do not have pip, 
see http://www.pip-installer.org/en/latest/installing.html.

Then

pip install colorama
or
sudo pip install colorama

Ba-boom! Done.

Source
https://stackoverflow.com/questions/9846683/how-to-install-colorama-python

Si sostienes alguna incertidumbre y capacidad de limar nuestro escrito puedes ejecutar una nota y con mucho placer lo analizaremos.

¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)



Utiliza Nuestro Buscador

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *