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: 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 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> <53565ECE.2060307@rece.vub.ac.be> In-Reply-To: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On 22-04-14 14:26, Chris Angelico wrote: > On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon > 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