Python: How can I make the ANSI escape codes to work also in Windows?
Question: If I run this in python under linux it works:

    
    
    start = "\033[1;31m"
    end = "\033[0;0m"
    print "File is: " + start + "<placeholder>" + end
    

But if I run it in Windows it doesn't work, how can I make the ANSI escape
codes work also on Windows?


Answer: You could check [Python module to enable ANSI for stdout on
Windows?](http://stackoverflow.com/questions/8358533/python-module-to-enable-
ansi-for-stdout-on-windows) to see if it's useful.

The [colorama](http://pypi.python.org/pypi/colorama) module seems to be cross-
platform.

You install colorama:

    
    
    pip install colorama
    

Then:

    
    
    import colorama
    colorama.init()
    start = "\033[1;31m"
    end = "\033[0;0m"
    print "File is: " + start + "<placeholder>" + end
    

