Manipulating time and so…

Module Contents

class'It', precision=3, callback=print)[source]

A very simple, accurate and easy to use timer context


Starts the timers


Stops the timer

property seconds(self)[source]

The elapsed time in seconds

property cpu_seconds(self)[source]

The elapsed CPU time in seconds


Call the callback function with the logging message

class, callback=print)[source]

A timed callback caller, which only executes once in a given interval.


Reset the timestamp*exceptions)[source]

Ignore-context for a given list of exceptions.

with ignored(AttributeError):

foo.a = 1[source]

Return peak memory usage in MB[source][source][source][source][source][source] = \033[0m[source] = \033\[0m[source], color=None, on_color=None, attrs=None, ansi_code=None)[source]

Colorize text, while stripping nested ANSI color sequences.

Author: Konstantin Lepa <> / termcolor

Available text colors:

red, green, yellow, blue, magenta, cyan, white.

Available text highlights:

on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan, on_white.

Available attributes:

bold, dark, underline, blink, reverse, concealed.


colored(‘Hello, World!’, ‘red’, ‘on_grey’, [‘blue’, ‘blink’]) colored(‘Hello, World!’, ‘green’), color=None, on_color=None, attrs=None)[source]

Print colorize text.

Author: Konstantin Lepa <> / termcolor

It accepts arguments of print function.[source]

Check if running within a Jupyter notebook[source]

Checks if the terminal supports color.