A suggestion for python 2.1.

Raja S. raja at cs.indiana.edu
Thu Oct 19 10:01:03 EDT 2000


since you seem to be running your scripts under Unix, why don't you just
use the conventional shell trick ?

#!/usr/local/bin/python

or 

#!/usr/bin/env python

as the first line in your scripts.  Put them in your $HOME/bin (assuming
that is in your $PATH) and turn on execution permissions (e.g., chmod a+x
cleanup).  You'll also need to do a 'rehash'.  From then on:

% cleanup

will work

Raja

olczyk at interaccess.com (Thaddeus L. Olczyk) writes:

>A new enviromental variable I call it PYTHONSCRIPTPATH,
>but maybe someone can come up with a better name.
>The idea of this variable is this.
>I write a bunch of scripts for doing system stuff,
>and I want to store them in one or two directories ( some may even be
>stored in common areas ). Call one cleanup.py which deletes
>extraneous files ( *.o, #*# ( emacs aborted exit ),*~(emacs backup))
>in the present directory.
>The way I would like to run it is:
>python cleanup(.py)
>the way I have to write it is 
>python directoryWhereCleanupIsStored/cleanup.py
>I've tried various tricks for this ( modifying PATH and PYTHONPATH ),
>and have no real way to make it work.



More information about the Python-list mailing list