Created
May 15, 2012 18:14
-
-
Save mtornwall/2703885 to your computer and use it in GitHub Desktop.
perror utility in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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