Strange syntax error, occurs only when script is executed directly [solved]

Antoon Pardon antoon.pardon at rece.vub.ac.be
Tue Apr 22 09:01:45 EDT 2014


On 22-04-14 14:26, Chris Angelico wrote:

> On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon
> <antoon.pardon at rece.vub.ac.be> wrote:
>> Yes that was it. I changed the first line of my script to:
>>
>> #!/opt/local/bin/python2.7
>>
>> and it now works.
> Excellent! Shebangs are *extremely* specific, so you may want to
> consider using "/usr/bin/env python" to get a bit more flexibility.

The problem with that is that it doesn't work if python is not on
the (standard) path, like in this case.

-- 
Antoon Pardon





More information about the Python-list mailing list