Apr-02-2021, 10:50 PM
I'm trying to redirect stderr to a file, and I've read the numerous posts here, but it's not working for me on a Pi or on my Win laptop.
Hoping someone will see what's wrong.
Using IDLE -
On Pi, the file is written but is empty, and stderr (traceback - /0) wasn't written to the IDLE shell....
On Win, the file is written but is empty, and stderr (traceback - /0 ) still appears in the IDLE shell.
import sys
import time
sys.stderrr = open('errout.txt', 'w')
print("stderr redirected now.")
i = 1/0
Hoping someone will see what's wrong.
Using IDLE -
On Pi, the file is written but is empty, and stderr (traceback - /0) wasn't written to the IDLE shell....
On Win, the file is written but is empty, and stderr (traceback - /0 ) still appears in the IDLE shell.
import sys
import time
sys.stderrr = open('errout.txt', 'w')
print("stderr redirected now.")
i = 1/0