🌐
PyPI
pypi.org › project › termcolor
termcolor · PyPI
import sys from termcolor import colored, cprint text = colored("Hello, World!", "red", attrs=["reverse", "blink"]) print(text) cprint("Hello, World!", "green", "on_red") print_red_on_cyan = lambda x: cprint(x, "red", "on_cyan") print_red_on_cyan("Hello, World!") print_red_on_cyan("Hello, Universe!") for i in range(10): cprint(i, "magenta", end=" ") cprint("Attention!", "red", attrs=["bold"], file=sys.stderr) # You can also specify 0-255 RGB ints via a tuple cprint("Both foreground and background can use tuples", (100, 150, 250), (50, 60, 70))
🌐
GitHub
github.com › termcolor › termcolor
GitHub - termcolor/termcolor: ANSI color formatting for output in terminal · GitHub
import sys from termcolor import colored, cprint text = colored("Hello, World!", "red", attrs=["reverse", "blink"]) print(text) cprint("Hello, World!", "green", "on_red") print_red_on_cyan = lambda x: cprint(x, "red", "on_cyan") print_red_on_cyan("Hello, World!") print_red_on_cyan("Hello, Universe!") for i in range(10): cprint(i, "magenta", end=" ") cprint("Attention!", "red", attrs=["bold"], file=sys.stderr) # You can also specify 0-255 RGB ints via a tuple cprint("Both foreground and background can use tuples", (100, 150, 250), (50, 60, 70))
🌐
pytz
pythonhosted.org › monty › _modules › monty › termcolor.html
monty.termcolor — monty 1.0.0 documentation
.. Example: colored_key("foo bar", {bar: "green"}) colored_key("foo bar", {bar: {"color": "green", "on_color": "on_red"}}) """ if not __ISON: return text for key, v in cmap.items(): if isinstance(v, dict): text = text.replace(key, colored(key, **v)) else: text = text.replace(key, colored(key, color=v)) return text def cprint_map(text, cmap, **kwargs): """ Print colorize text. cmap is a dict mapping keys to color options. kwargs are passed to print function Example: cprint_map("Hello world", {"Hello": "red"}) """ try: print(colored_map(text, cmap), **kwargs) except TypeError: # flush is not sup
🌐
GitHub
github.com › hfeeki › termcolor
GitHub - hfeeki/termcolor: fork of termcolor Python library · GitHub
import sys from termcolor import colored, cprint text = colored('Hello, World!', 'red', attrs=['reverse', 'blink']) print(text) cprint('Hello, World!', 'green', 'on_red') print_red_on_cyan = lambda x: cprint(x, 'red', 'on_cyan') print_red_on_cyan('Hello, World!') print_red_on_cyan('Hello, Universe!') for i in range(10): cprint(i, 'magenta', end=' ') cprint("Attention!", 'red', attrs=['bold'], file=sys.stderr)
Author: hfeeki
🌐
ProgramCreek
programcreek.com › python › example › 78943 › termcolor.colored
Python Examples of termcolor.colored
def format(self, record): date = colored('[%(asctime)s @%(filename)s:%(lineno)d]', 'green') msg = '%(message)s' if record.levelno == logging.WARNING: fmt = date + ' ' + colored('WRN', 'red', attrs=['blink']) + ' ' + msg elif record.levelno == logging.ERROR or record.levelno == logging.CRITICAL: fmt = date + ' ' + colored('ERR', 'red', attrs=['blink', 'underline']) + ' ' + msg elif record.levelno == logging.DEBUG: fmt = date + ' ' + colored('DBG', 'yellow', attrs=['blink']) + ' ' + msg else: fmt = date + ' ' + msg if hasattr(self, '_style'): # Python3 compatibility self._style._fmt = fmt self._
🌐
PyPI
pypi.org › project › termcolor › 0.2
termcolor 0.2
JavaScript is disabled in your browser. Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
PyPI
pypi.org › project › termcolor-dg
termcolor-dg
JavaScript is disabled in your browser. Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
GeeksforGeeks
geeksforgeeks.org › print-colors-python-terminal
Print Colors in Python terminal - GeeksforGeeks
June 27, 2022 - Example: Python program to print colored text and background. ... import sys from termcolor import colored, cprint text = colored('Hello, World!', 'red', attrs=['reverse', 'blink']) print(text) cprint('Hello, World!', 'green', 'on_red') def print_red_on_cyan(x): return cprint(x, 'red', 'on_cyan') print_red_on_cyan('Hello, World!') print_red_on_cyan('Hello, Universe!') for i in range(10): cprint(i, 'magenta', end=' ') cprint("Attention!", 'red', attrs=['bold'], file=sys.stderr)
🌐
Pythonacademy
pythonacademy.io › home › articles › python termcolor
Python Termcolor - Python Tutorial | PythonAcademy
Learn Python Termcolor with code examples, best practices, and tutorials. Complete guide for Python developers.
Find elsewhere
🌐
Plain English
python.plainenglish.io › this-is-how-you-color-print-out-in-python-387b262f24f6
This is How You Color Print Out in Python | by Julio Souto | Python in Plain English
May 31, 2021 - from termcolor import colored, cprinttry: int('Hello World') print(colored('Success', 'green', attrs=['reverse', 'blink'])) except Exception as E: print(colored(str(E), 'red', attrs=['reverse', 'blink']))
🌐
Debian
packages.debian.org › sid › python3-termcolor
Debian -- Details of package python3-termcolor in sid
The termcolor Python module provides ANSII Color formatting for output in terminal.
🌐
PyPI
pypi.python.org › pypi › termcolor › 2.0.1
termcolor · PyPI
import sys from termcolor import colored, cprint text = colored("Hello, World!", "red", attrs=["reverse", "blink"]) print(text) cprint("Hello, World!", "green", "on_red") print_red_on_cyan = lambda x: cprint(x, "red", "on_cyan") print_red_on_cyan("Hello, World!") print_red_on_cyan("Hello, Universe!") for i in range(10): cprint(i, "magenta", end=" ") cprint("Attention!", "red", attrs=["bold"], file=sys.stderr)
Published: Sep 12, 2022
Version: 2.0.1
🌐
Finxter
blog.finxter.com › home › learn python blog › how to install termcolor in python?
How to Install termcolor in Python? - Be on the Right Side of Change
July 6, 2022 - This article will show you everything ... bar and hit Enter to open the command line. Type “pip install termcolor” (without quotes) in the command line and hit Enter again....
🌐
GitHub
github.com › termcolor › termcolor › blob › main › README.md
termcolor/README.md at main · termcolor/termcolor
import sys from termcolor import colored, cprint text = colored("Hello, World!", "red", attrs=["reverse", "blink"]) print(text) cprint("Hello, World!", "green", "on_red") print_red_on_cyan = lambda x: cprint(x, "red", "on_cyan") print_red_on_cyan("Hello, World!") print_red_on_cyan("Hello, Universe!") for i in range(10): cprint(i, "magenta", end=" ") cprint("Attention!", "red", attrs=["bold"], file=sys.stderr) # You can also specify 0-255 RGB ints via a tuple cprint("Both foreground and background can use tuples", (100, 150, 250), (50, 60, 70))
Author: termcolor
🌐
GitHub
github.com › termcolor › termcolor › blob › main › src › termcolor › termcolor.py
termcolor/src/termcolor/termcolor.py at main · termcolor/termcolor
ANSI color formatting for output in terminal. Contribute to termcolor/termcolor development by creating an account on GitHub.
Author: termcolor
🌐
PyPI
pypi.org › project › termcolor-whl
termcolor-whl · PyPI
import sys from termcolor import colored, cprint text = colored('Hello, World!', 'red', attrs=['reverse', 'blink']) print(text) cprint('Hello, World!', 'green', 'on_red') print_red_on_cyan = lambda x: cprint(x, 'red', 'on_cyan') print_red_on_cyan('Hello, World!') print_red_on_cyan('Hello, Universe!') for i in range(10): cprint(i, 'magenta', end=' ') cprint("Attention!", 'red', attrs=['bold'], file=sys.stderr)
🌐
Gentoo
packages.gentoo.org › packages › dev-python › termcolor
dev-python/termcolor – Gentoo Packages
https://pypi.org/project/termcolor/ Upstream · USE flags · Global Use Flags · test · verify-provenancepython_targets (Use Expand) python3_12 · python3_13 · python3_14 · License · MIT · Maintainer(s) Matthew Thode , Python · Related bugs · Package Contents · CI Report (verbose) Repology · Release-Monitoring · Open Pull Requests · Documentation ·
🌐
Context7
context7.com › home › libraries › websites/pypi_help
Termcolor (websites/pypi_help) | Context7
Termcolor is a Python library that provides ANSI color formatting for terminal output, enabling developers to easily add colors and text attributes to console applications. - Latest version
🌐
Vultr
docs.vultr.com › python › examples › print colored text to the terminal
Python Program to print colored text to the terminal
December 26, 2024 - By leveraging library support and exploring different methodologies, you can incorporate colored outputs into your Python scripts for more vibrant and distinguishable console logs. To begin, install the termcolor module if it's not already available in your Python environment.
🌐
Anaconda.org
anaconda.org › anaconda › termcolor
termcolor - anaconda | Anaconda.org
GitHub Repository https://github.com/termcolor/termcolor · Documentation https://github.com/termcolor/termcolor/blob/main/README.md