MCPcopy
hub / github.com/glamp/bashplotlib / printcolour

Function printcolour

bashplotlib/utils/helpers.py:36–46  ·  view source on GitHub ↗

Print color text using escape codes

(text, sameline=False, colour="default")

Source from the content-addressed store, hash-verified

34
35
36def printcolour(text, sameline=False, colour="default"):
37 """
38 Print color text using escape codes
39 """
40 sep = '' if sameline else '\n'
41
42 # If no colour set, do not print color ESC characters
43 if get_colour(colour) == get_colour("ENDC"):
44 sys.stdout.write(text + sep)
45 else:
46 sys.stdout.write(get_colour(colour) + text + get_colour("ENDC") + sep)
47
48
49def drange(start, stop, step=1.0, include_stop=False):

Callers 2

_plot_scatterFunction · 0.85
plot_histFunction · 0.85

Calls 1

get_colourFunction · 0.85

Tested by

no test coverage detected