Skip to content

Instantly share code, notes, and snippets.

@mtornwall
Created May 15, 2012 18:14
Show Gist options
  • Save mtornwall/2703885 to your computer and use it in GitHub Desktop.
Save mtornwall/2703885 to your computer and use it in GitHub Desktop.
perror utility in python
#!/usr/bin/env python
import sys
import os
def usage():
print 'usage: {} [errno]'.format(sys.argv[0])
sys.exit(1)
if __name__ == '__main__':
if len(sys.argv) != 2:
usage()
try:
print os.strerror(int(sys.argv[1]))
except ValueError:
usage()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment