title: How to generate a Python output file with color formatting?
body: <p>How can I instruct python to generate an output file which keeps the color formatting specified in the main script?</p>
  
  <p>I am working on the WRDS Cloud and I am using a shell file to execute a python script. The Cloud returns an output file which I can download and open like it is a txt file. However, this does not keep the color formatting that I specified in my original code. </p>
  
  <p>I have tried to use different formatting packages in my python script but the result is always the same: the color is not displayed in the output file. I would really need to see the color because I use it to highlight some particular messages that represent warnings or errors. Therefore, I assume the only way around this is to instruct my python script to generate a different type of output, but I cannot figure out how.</p>
  
  <p>my python script looks like this:</p>
  
  <pre><code>from colorama import *
  init()
  print(Fore.MAGENTA + 'Warning: The query failed' + Fore.RESET)
  </code></pre>
  
  <p>the output file looks like this (with no magenta color):</p>
  
  <pre><code>Warning: The query failed
  </code></pre>