[Tutor] self finding

Mathew P. highdesertman@yahoo.com
Wed, 7 Aug 2002 13:59:21 -0700 (PDT)


--- Sean 'Shaleh' Perry <shalehperry@attbi.com> wrote:
> 
> On 07-Aug-2002 Kirk Bailey wrote:
> > ok, someone a LONG time ago wrote how to get the script to FIND the
> > interpreter. Do not now have that message thanks to a HDD failure.
> > although it might take a script longer to start, this is a major
> feature
> > if you want to make it EASIER THAN PIE to install and use. Anyone a
> real
> > un*x maven who would care to address how to do this- and it was all
> on
> > ONE LINE, a number of interesting characters were in it, some
> escape
> > stuff, beat me now, working from memory. any clues?
> > -- 
> > 
> 
> #!/usr/bin/env python
This will do it, if you have the env script installed on your system.
This script locates the python interpreter according to your system
search-path settings (ie. the path statement). This method can make
code more portable, since you don't have to know where the python
interpreter is installed on every system your code will run on. The
downside is that env may not exist on every machine you are running on.
But then, we do live in an imperfect world.

Cheers,

Mathew


__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com