Skip to content

Instantly share code, notes, and snippets.

@vsajip
Created June 24, 2011 13:49
Show Gist options
  • Save vsajip/1044799 to your computer and use it in GitHub Desktop.
Save vsajip/1044799 to your computer and use it in GitHub Desktop.
Example script for entry point module.path.callable
#!/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