I would like to redirect the standard error and standard output of a Python script to the same output file. From the terminal I could use
$ python myfile.py
This works
sys.stdout = open('out.log', 'w') sys.stderr = sys.stdout