avoiding long paths to interpreter

Trent Mick trentm at ActiveState.com
Thu Jan 9 01:11:43 CET 2003

[Mathew Yeates wrote]
> in TCL, there is a trick where, instead of
> writing
> #![long path to tcl interpreter]
> you write
> #!/bin/sh
> .
> . some magic, I don't remember what
> .
> Is there an equivalent in python? What is the
> bast way to distibute a python script without
> knowing the users path to the python executable?

Using a shebang line like:
    #!/usr/bin/env python
seems pretty common in the Python world. In my experience /usr/bin/env
is generally there, so this works.


Trent Mick
TrentM at ActiveState.com

More information about the Python-list mailing list