Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Execute Python and log both stdout and stderr to a file
# 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 | tee output.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.