Coloured output text in In-line script?


#1

I have a in-line python script for mitmdump I would like to output coloured text to a terminal window.

I need it to work on all three platforms (Mac, Linux and Windows 7, 8 and 10) and importantly not require the installation of python, python modules or any other third party tool.

ANSI escape codes obviously would be the solution were it not for the fact that Windows 7 and 8 do not support them.

Since mitmproxy for Windows works without needing to install any form of python, and also prints coloured text to the terminal itself, there has to be a way, I just do not know what it is.

I tried “import urwid” but that says no such module.

I have searched for an answer and not found a solution, my apologies if I missed one.


#2

Duplicate of https://stackoverflow.com/questions/47799382/