Skip to content

Instantly share code, notes, and snippets.

@lig
Last active April 19, 2017 05:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lig/b4b4d0665292e09616a18239ee335142 to your computer and use it in GitHub Desktop.
Save lig/b4b4d0665292e09616a18239ee335142 to your computer and use it in GitHub Desktop.
stdouterr
$ python3 stdouterr.py
stdout
stderr
$ python3 stdouterr.py 2>&1 >/dev/null
stderr
$ python3 stdouterr.py &>/dev/null
$ python3 stdouterr.py >/dev/null 2>&1
$ python3 stdouterr.py >/dev/null
stderr
import sys
sys.stdout.write("stdout\n")
sys.stderr.write("stderr\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment