why use #!/usr/bin/env python rather than #!python?

Fredrik Lundh fredrik at pythonware.com
Fri Dec 2 09:08:52 EST 2005


Adriano Ferreira wrote:

> Many Python scripts I see start with the shebang line
>
> #!/usr/bin/env python
>
> What is the difference from using just
>
> #!python

$ more test.py
#!python
print "hello"
$ chmod +x test.py
$ ./test.py
-bash: ./test.py: python: bad interpreter: No such file or directory

</F> 






More information about the Python-list mailing list