#StackBounty: #windows #python #cmd.exe #stdout #stderr How do I redirect output from python to file

Bounty: 50

I want to redirect all output (stdout and stderr) of console to the text file. I make the following steps:

  1. Open cmd.exe
  2. Start command:

    “python.exe” > “file.txt”

After that, I’m waiting for the python’s output in the file, but it’s still in console. What I’m doing wrong?

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.