Last active
May 2, 2018 06:59
-
-
Save otrenav/92a366c9f405dd9d56ed01d897b9262c to your computer and use it in GitHub Desktop.
Execute Python and log both stdout and stderr to a file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Print Python script output as well as save it to a file. The `-u` | |
# switch tells Python to avoid buffering `stderr` and `stdout` | |
# which is required by `tee` to save the output to the file. | |
# | |
python -u main.py | tee output.log | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment