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


Groups > comp.lang.python > #70504

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

References <535644A4.6060901@rece.vub.ac.be> <CAPTjJmoXsBDf6kwWk8EqqkX7N+n++t_P87VVVROc1OcW_N9K8g@mail.gmail.com> <53565ECE.2060307@rece.vub.ac.be>
Date 2014-04-22 22:26 +1000
Subject Re: Strange syntax error, occurs only when script is executed directly [solved]
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.9437.1398169617.18130.python-list@python.org> (permalink)

Show all headers | View raw


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.
(Or "python2" or "python2.7" in place of "python", depending on how
specific you want to be.)

ChrisA

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Strange syntax error, occurs only when script is executed directly [solved] Chris Angelico <rosuav@gmail.com> - 2014-04-22 22:26 +1000
  Re: Strange syntax error, occurs only when script is executed directly [solved] Andrew Cooper <root@127.0.0.1> - 2014-04-23 02:42 +0100
  Re: Strange syntax error, occurs only when script is executed directly [solved] Andrew Cooper <root@127.0.0.1> - 2014-04-23 02:42 +0100

csiph-web