title: Saving text color to a text file in python?
body: <p>I am wondering, is there any way to save the color of text when printing stdout to a text file? Here is a snippet of code for example:</p>
  
  <pre><code>import sys, time, shutil
  
  sys.stdout = open('testytest.txt', 'w')
  print "\033[0;32mSome text"
  
  time.sleep(1)
  
  #"Some text" should still be colored when reprinted
  with open('testytest.txt', 'r') as testfile:
       shutil.copyfileobj(testfile, sys.stdout)
  </code></pre>
  
  <p>So, once again, is there any way to save color when stdout is being saved to a text file? Or is it already saved?</p>