Is there a list of ANSI color escape codes somewhere in the standard libraries?
问题 I write a lot of little helper scripts, and often these print coloured text in the terminal. For the simplicity of their packaging and distribution, I often want these little scripts to be without any dependencies. Hence I'm duplicating data like this a lot in scripts: ansi_colors = { None: '\x1b[0m', # actually black but whatevs 'red': '\x1b[31m', 'green' : '\x1b[32m', ... } Does this data exist anywhere in the core libraries? I dug around and found that curses has some COLOR_* constants,