Created
June 24, 2011 13:49
-
-
Save vsajip/1044799 to your computer and use it in GitHub Desktop.
Example script for entry point module.path.callable
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 | |
if __name__ == '__main__': | |
import os, sys, module.path | |
rc = 1 | |
try: | |
if 'callable-script.py' in sys.argv[0]: | |
parts = os.path.split(sys.argv[0]) | |
sys.argv[0] = os.path.join(parts[0], 'callable') | |
rc = module.path.callable() | |
except Exception: | |
# use syntax which works with either 2.x or 3.x | |
sys.stderr.write('%%s\n', sys.exc_info()[1]) | |
sys.exit(rc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment