Important

This documentation covers IPython versions 6.0 and higher. Beginning with version 6.0, IPython stopped supporting compatibility with Python versions lower than 3.3 including all versions of Python 2.7.

If you are looking for an IPython version compatible with Python 2.7, please use the IPython 5.x LTS release and refer to its documentation (LTS is the long term support release).

Module: utils.PyColorize

3 Classes

class IPython.utils.PyColorize.Symbols

Bases: TypedDict

class IPython.utils.PyColorize.Theme(name, base, extra_style, *, symbols={})

Bases: object

__init__(name, base, extra_style, *, symbols={})
make_arrow(width: int)

generate the leading arrow in front of traceback or debugger

class IPython.utils.PyColorize.Parser(out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, *, theme_name: str = None)

Bases: object

Format colored Python source.

__init__(out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, *, theme_name: str = None)

Create a parser with a specified color table and output channel.

Call format() to process code.

format2(raw, out=None)

Parse and send the colored source.

If out is not specified, the defaults (given to constructor) are used.

out should be a file-type object. Optionally, out can be given as the string ‘str’ and the parser will automatically return the output in a string.