Example script for entry point module.path.callable (original) (raw)

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

[ Show hidden characters]({{ revealButtonHref }})

#!/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)