title: Redirect output of python script in new cmd into a text file
body: <p>I would run a child process from NodeJS
  <code>start cmd.exe python test.py arg1 arg2 &gt;&gt; output.txt</code> all on windows environment.</p>
  <p>However, no output is shown in the text file.
  But when I remove the <code>start cmd.exe</code> and simply do <code>python test.py arg1 arg2 &gt;&gt; output.txt</code> then I can see the output.</p>
  <p>How can I elegantly redirect output in a new cmd window running a python script into some text file?</p>
  <p>In fact, the main reason why I start the python in a new cmd is so I can real-time see the console output, I do not know a very good way to simultaneously log console output into a text file, print it into cmd live, and send to the server to display to end users all at once.
  It seems I can only do one or the other. Also, I have searched about printing to console + logging to a text file, but most of the answers are about logging and then printing to console the entire output of the whole program lifetime. Yet I want to do it print and log bit by bit rather than at once in the end.</p>
  <p>Extra info:
  Ultimately I want to monitor a python script running and log any possible errors and progression stages into a text file. Currently, I use HTTP messages to push print statements into a NodeJS server, however, it does not push error messages if the python script dies. I want to let the user know these error messages too. In fact, the python script and NodeJS server are on the same machine, it would be even more efficient I believe to have the python script redirect the print statements into the server javascript but I do not know how to do it (maybe with some stdout) and so I resort to using HTTP messages.</p>