I've added the following line to a python file in order to output all print
strings to a file:
sys.stdout = open(logf, 'wb')
This does what I wanted, but also stops all print
strings from appearing in the terminal. Is there a way to configure stdout to print to both destinations? (I'm trying to avoid writing a function for each use of print
because there are many and it's a lot to rewrite. Also, I've perused several similar topics, but I haven't found a simple method.)