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


Groups > comp.lang.python > #70507

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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <antoon.pardon@rece.vub.ac.be>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:error': 0.03; 'received:134': 0.05; '22,': 0.09; 'subject:script': 0.09; 'works.': 0.09; 'python': 0.11; '14:26,': 0.16; 'excellent!': 0.16; 'specific,': 0.16; 'subject:when': 0.16; 'skip:# 20': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'header:User-Agent:1': 0.23; 'case.': 0.24; 'script': 0.25; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; "doesn't": 0.30; 'python"': 0.31; 'problem': 0.35; 'subject:]': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'changed': 0.39; 'first': 0.61; 'more': 0.64; 'yes': 0.68; 'pardon': 0.84
X-IronPort-Anti-Spam-Filtered true
X-IronPort-Anti-Spam-Result AqAEAOtmVlOGuA9G/2dsb2JhbABZhzvBB4EtgxkBAQQBI1UGCwsYAgIFFgsCAgkDAgECAUUTBgICiDUIqR6dGYYUF4EpjTQWglmBSQEDmHCGQowQgzM
Date Tue, 22 Apr 2014 15:01:45 +0200
From Antoon Pardon <antoon.pardon@rece.vub.ac.be>
User-Agent Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Icedove/24.4.0
MIME-Version 1.0
To python-list@python.org
Subject 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> <CAPTjJmqvZRUwjTTc6ND8tK5fieoH-8UY0R2YJxNYjbm6_jXMrQ@mail.gmail.com>
In-Reply-To <CAPTjJmqvZRUwjTTc6ND8tK5fieoH-8UY0R2YJxNYjbm6_jXMrQ@mail.gmail.com>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.9439.1398171706.18130.python-list@python.org> (permalink)
Lines 19
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1398171706 news.xs4all.nl 2974 [2001:888:2000:d::a6]:33643
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:70507

Show key headers only | View raw


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.

-- 
Antoon Pardon

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


Thread

Re: Strange syntax error, occurs only when script is executed directly [solved] Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-04-22 15:01 +0200

csiph-web