run .py not in PATH
Darrell
news at dorb.com
Tue Jun 29 14:43:46 EDT 1999
#!/usr/bin/env python
"""
The .py you want to run is in the python path but not
in your shell path.
I know everyone but me already has this problem solved
in a better way than this. If so please show me the way.
Assuming this is runIt.py then
runIt.py someScript.py arg1 arg2
"""
import sys
import imp
fp, pathname, description = imp.find_module(sys.argv[1])
sys.argv=sys.argv[2:]
md=imp.load_module('__main__', fp, pathname, description)
More information about the Python-list
mailing list