Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0b52aad

Browse files
committed
Add more docs
1 parent ff19eec commit 0b52aad

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Doc/using/cmdline.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,26 @@ Miscellaneous options
612612
.. versionadded:: 3.13
613613
The ``-X presite`` option.
614614

615+
Controlling Color
616+
~~~~~~~~~~~~~~~~~
617+
618+
The Python interpreter is configured by default to use colors to highlight
619+
output in certain situations such as when displaying tracebacks. This
620+
behavior can be controlled by setting different environment variables.
621+
622+
Setting the environment variable ``TERM`` to ``dumb`` will disable color.
623+
624+
If the environment variable ``FORCE_COLOR`` is set, then color will be
625+
enabled regardless of the value of TERM. This is useful on CI systems which
626+
aren’t terminals but can none-the-less display ANSI escape sequences.
627+
628+
If the environment variable ``NO_COLOR`` is set, Python will disable all color
629+
in the output. This takes precedence over ``FORCE_COLOR``.
630+
631+
All these environment variables are used also by other tools to control color
632+
output. To control the color output only in the Python interpreter, the
633+
:envvar:`PY_COLORS` environment variable can be used. This variable takes
634+
less precedence than ``NO_COLOR`` and ``FORCE_COLOR``.
615635

616636
Options you shouldn't use
617637
~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)