How do I redirect stdout to an arbitrary file in Python?
When a long-running Python script (e.g, web application) is started from within the ssh session and backgoun
import sys sys.stdout = open('stdout.txt', 'w')