Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
PyPI

termcolor 2.5.0

pip install termcolor

Latest version

Released:

ANSI color formatting for output in terminal

Verified details

These details have beenverified by PyPI
Project links
GitHub Statistics
Maintainers
Avatar for hugovk from gravatar.com hugovk

Unverified details

These details havenot been verified by PyPI
Meta
  • License: MIT License (MIT)
  • Author:Konstantin Lepa
  • Maintainer: Hugo van Kemenade
  • Tags ANSI, ANSI color, ANSI colour, color, colour, formatting, termcolor, terminal
  • Requires: Python >=3.9
  • Provides-Extra:tests

Project description

termcolor

PyPI versionSupported Python versionsPyPI downloadsGitHub Actions statusCodecovLicenceCode style: BlackTidelift

Installation

From PyPI

python3-mpipinstall--upgradetermcolor

From source

gitclonehttps://github.com/termcolor/termcolorcdtermcolorpython3-mpipinstall.

Demo

To see demo output, run:

python3-mtermcolor

Example

importsysfromtermcolorimportcolored,cprinttext=colored("Hello, World!","red",attrs=["reverse","blink"])print(text)cprint("Hello, World!","green","on_red")print_red_on_cyan=lambdax:cprint(x,"red","on_cyan")print_red_on_cyan("Hello, World!")print_red_on_cyan("Hello, Universe!")foriinrange(10):cprint(i,"magenta",end=" ")cprint("Attention!","red",attrs=["bold"],file=sys.stderr)

Text properties

Text colorsText highlightsAttributes
blackon_blackbold
redon_reddark
greenon_greenunderline
yellowon_yellowblink
blueon_bluereverse
magentaon_magentaconcealed
cyanon_cyanstrike
whiteon_white
light_greyon_light_grey
dark_greyon_dark_grey
light_redon_light_red
light_greenon_light_green
light_yellowon_light_yellow
light_blueon_light_blue
light_magentaon_light_magenta
light_cyanon_light_cyan

Terminal properties

Terminalbolddarkunderlineblinkreverseconcealed
xtermyesnoyesboldyesyes
linuxyesyesboldyesyesno
rxvtyesnoyesbold/blackyesno
dttermyesyesyesreverseyesyes
teratermreversenoyesrev/redyesno
aixtermnormalnoyesnoyesyes
PuTTYcolornoyesnoyesno
Windowsnonononoyesno
Cygwin SSHyesnocolorcolorcoloryes
Mac Terminalyesnoyesyesyesyes

Overrides

Terminal colour detection can be disabled or enabled in several ways.

In order of precedence:

  1. Callingcolored orcprint with a truthyno_color disables colour.
  2. Callingcolored orcprint with a truthyforce_color forces colour.
  3. Setting theANSI_COLORS_DISABLED environment variable to any value disables colour.
  4. Setting theNO_COLOR environment variable to any valuedisables colour.
  5. Setting theFORCE_COLOR environment variable to anyvalue forces colour.
  6. Setting theTERM environment variable todumb, or using such adumb terminal,disables colour.
  7. Finally, termcolor will attempt to detect whether the terminal supports colour.

Project details

Verified details

These details have beenverified by PyPI
Project links
GitHub Statistics
Maintainers
Avatar for hugovk from gravatar.com hugovk

Unverified details

These details havenot been verified by PyPI
Meta
  • License: MIT License (MIT)
  • Author:Konstantin Lepa
  • Maintainer: Hugo van Kemenade
  • Tags ANSI, ANSI color, ANSI colour, color, colour, formatting, termcolor, terminal
  • Requires: Python >=3.9
  • Provides-Extra:tests

Download files

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

Source Distribution

termcolor-2.5.0.tar.gz (13.1 kBview details)

UploadedSource

Built Distribution

termcolor-2.5.0-py3-none-any.whl (7.8 kBview details)

UploadedPython 3

File details

Details for the filetermcolor-2.5.0.tar.gz.

File metadata

  • Download URL: termcolor-2.5.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for termcolor-2.5.0.tar.gz
AlgorithmHash digest
SHA256998d8d27da6d48442e8e1f016119076b690d962507531df4890fcd2db2ef8a6f
MD526f496075070852b5d39762bbd14ec46
BLAKE2b-256377288311445fd44c455c7d553e61f95412cf89054308a1aa2434ab835075fc5

See more details on using hashes here.

Provenance

The following attestation bundles were made fortermcolor-2.5.0.tar.gz:

Publisher:deploy.yml on termcolor/termcolor

Attestations:Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the filetermcolor-2.5.0-py3-none-any.whl.

File metadata

  • Download URL: termcolor-2.5.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for termcolor-2.5.0-py3-none-any.whl
AlgorithmHash digest
SHA25637b17b5fc1e604945c2642c872a3764b5d547a48009871aea3edd3afa180afb8
MD5a7f44cd6975ff6cd5e052fa2616c2c22
BLAKE2b-2567fbedf630c387a0a054815d60be6a97eb4e8f17385d5d6fe660e1c02750062b4

See more details on using hashes here.

Provenance

The following attestation bundles were made fortermcolor-2.5.0-py3-none-any.whl:

Publisher:deploy.yml on termcolor/termcolor

Attestations:Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWSAWS Cloud computing and Security SponsorDatadogDatadog MonitoringFastlyFastly CDNGoogleGoogle Download AnalyticsPingdomPingdom MonitoringSentrySentry Error loggingStatusPageStatusPage Status page

[8]ページ先頭

©2009-2025 Movatter.jp