Skip to content

Instantly share code, notes, and snippets.

@Avantol13
Last active September 23, 2016 19:17
Show Gist options
  • Save Avantol13/e1410af58232ad101a4d5f186eba4398 to your computer and use it in GitHub Desktop.
Save Avantol13/e1410af58232ad101a4d5f186eba4398 to your computer and use it in GitHub Desktop.
# Redirect print output to null device on operating system
print_redirect = open(os.devnull, 'w')
sys.stdout = print_redirect
# See this: http://stackoverflow.com/a/6735958/4175042
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment