Skip to content

Instantly share code, notes, and snippets.

@jdevera
Last active January 19, 2020 23:05
Show Gist options
  • Save jdevera/2f97ac9e0706b4ee4224c1c8ae3b60c6 to your computer and use it in GitHub Desktop.
Save jdevera/2f97ac9e0706b4ee4224c1c8ae3b60c6 to your computer and use it in GitHub Desktop.
My most rewritten function: die
import sys
def die(*messages, rc=1):
"""
Print the arguments in stderr and exit with a given return code
"""
print(*messages, file=sys.stderr)
sys.exit(rc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment