run .py not in PATH

Darrell Darrell at p98.f112.n480.z2.fidonet.org
Tue Jun 29 06:43:46 EDT 1999


From: "Darrell" <news at dorb.com>

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