title: saving output with sys.stdout, but I want to show it on console/terminal
body: <p>So for analysis, I want to save everything the scripts outputs on the console/terminal, and for that I used <code>sys.stdout</code>:</p>
  
  <p><em>My code:</em></p>
  
  <pre><code>sys.stdout = open('logFile.dat', 'w')
  # TOO MUCH LINES OF CODE
  sys.stdout.close()
  </code></pre>
  
  <p>My program is quite large, and there isn't point to copy-paste it here, because It doesn't affect my question.</p>
  
  <p>So with this I get what I wanted but on the other hand, the console is blank while the program is running and that is a problem for me, because I want for program to output stuff on the console.</p>
  
  <p>Is there anyway to get past this ?</p>