I have a directory which I would like to be the default for Python scripts so when a user is running python foo.py arg1 arg2 and foo.py is not in the current directory, it should execute python /defaultdir/foo.py arg1 arg2. Neither $PATH nor $PYTHONPATH is good for that: the first would only work with the command foo.py arg1 arg2, which requires a hashbang in the script and execution rights, while the second only works for import˙commands from an already running script. I suppose I could replace the Python binary with a wrapper, but I would prefer a cleaner solution if there was one.
-
1I’m afraid what you want is unreasonable.tchrist– tchrist2011-09-07 16:14:28 +00:00Commented Sep 7, 2011 at 16:14
-
the last alternative (replacing python binary) seems to be the best you presented. Anyway you'll need to tinker with some system aspect or another.heltonbiker– heltonbiker2011-09-07 16:15:17 +00:00Commented Sep 7, 2011 at 16:15
Add a comment
|