Created
June 27, 2012 03:23
-
-
Save hidsh/8a480933e8af1b614b15 to your computer and use it in GitHub Desktop.
python: utils
This file contains hidden or 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
# | |
# utils | |
# | |
def usage(exit_code=0): | |
print USAGE_MSG | |
sys.exit(exit_code) | |
def error_exit(msg='error occurred. quit.'): | |
print msg | |
sys.exit() | |
def pause(msg='Press ENTER to exit'): | |
raw_input(msg) # pause | |
def change_file_ext(path, new_ext): | |
root, ext = os.path.splitext(path) | |
return root + new_ext.lower() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment