Hack Forums
[Python] Print in different colors - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] Print in different colors (/showthread.php?tid=5708597)



Print in different colors - peter_man - Sep 1, 2017

I am writing a python script that will be run in cmd. How do I make it so that I can specify the color it prints in? Is this possible?

Edit: For everyone reading this. Use this library: pypi.python.org/pypi/colorama


* - Charger - Sep 1, 2017

Yes. You have to escape the colors https://misc.flogisoft.com/bash/tip_colors_and_formatting


* - peter_man - Sep 1, 2017

(Sep 1, 2017 03:27 PM)Charger Wrote:  Yes. You have to escape the colors

I tried this in Windows CMD, can't get it to work :(


Got it to work! Thanks!
gist.github.com/mlocati/fdabcaeb8071d5c75a2d51712db24011#file-win10colors-cmd