script portability trick

Steve Holden sholden at holdenweb.com
Thu Jan 17 15:32:31 EST 2002


"Russ" <18k11tm001 at sneakemail.com> wrote ...
> A traditional unix trick in Tcl/Tk is to start scripts like this:
> 
> #!/bin/sh
> # the next line starts wish \
> exec wish "$0" "$@"
> 
> This causes the Bourne shell to search the user's executable path to
> find wish each time the script is executed. Because the script doesn't
> depend on wish being in a particular directory, it is more portable
> (sh is almost always in /bin, but wish can be anywhere).
> 
> Is there a similar trick for Python? Thanks.

"How do I make a Python script executable":

    http://www.python.org/cgi-bin/faqw.py?req=show&file=faq04.063.htp

regards
 Steve
--
Consulting, training, speaking: http://www.holdenweb.com/
Python Web Programming: http://pydish.holdenweb.com/pwp/








More information about the Python-list mailing list