How to capture stdout of a Python script executed with pythonw?
<p>When a script is executed with <code>pythonw</code> it will not open a console.</p>

<p>Is there a way to capture the <code>stdout</code> of such a script by keeping the usage of <code>pythonw</code>?</p>

<p>Note, I am looking for a solution that does not require the modification of the script (I know that I can use logging)</p>

<p>Update: <code>pythonw script.py &gt;somefile</code> seems to work. How can I redirect it to console?</p>
