Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70508 > unrolled thread

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

Started byChris Angelico <rosuav@gmail.com>
First post2014-04-22 23:07 +1000
Last post2014-04-22 23:07 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Strange syntax error, occurs only when script is executed directly [solved] Chris Angelico <rosuav@gmail.com> - 2014-04-22 23:07 +1000

#70508 — Re: Strange syntax error, occurs only when script is executed directly [solved]

FromChris Angelico <rosuav@gmail.com>
Date2014-04-22 23:07 +1000
SubjectRe: Strange syntax error, occurs only when script is executed directly [solved]
Message-ID<mailman.9440.1398172053.18130.python-list@python.org>
On Tue, Apr 22, 2014 at 11:01 PM, Antoon Pardon
<antoon.pardon@rece.vub.ac.be> wrote:
> On 22-04-14 14:26, Chris Angelico wrote:
>
>> On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon
>> <antoon.pardon@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.

Ah! Well, that's why I said "consider using" rather than "you should use" :)

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web