How to print colour/color in python?

前端 未结 8 1165
有刺的猬
有刺的猬 2020-12-01 18:38

New to both Python and StackOverflow, I\'d like a little help. I\'d like to print color in Python and have Googled but with little luck :( I\'ve been confused each time and

8条回答
  •  情话喂你
    2020-12-01 19:19

    If you want to print to a terminal in color you have to use escape codes for the terminal you're using. For unix/linux systems you can use the curses module - or just use bash color codes directly as a part of your output string. There doesn't seem to be an easy way to do this in windows according to this question.

提交回复
热议问题