Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2a.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'syntax': 0.04; 'mrab': 0.05; 'modify': 0.07; 'python3': 0.07; 'versions.': 0.07; 'iterate': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'snippet': 0.09; 'subject:parsing': 0.09; 'python': 0.11; 'language.': 0.14; '3.1.3': 0.16; 'inclined': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'syntaxerror:': 0.16; 'url:peps': 0.16; 'language': 0.16; 'wrote:': 0.18; 'seems': 0.21; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'url:dev': 0.24; "i've": 0.25; '(see': 0.26; 'least': 0.26; '2010,': 0.27; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'related': 0.29; 'dec': 0.30; "i'm": 0.30; '>>>>': 0.31; 'file': 0.32; 'url:python': 0.33; 'skip:d 20': 0.34; "i'd": 0.34; 'subject:from': 0.34; 'could': 0.34; 'something': 0.35; 'yield': 0.36; 'url:org': 0.36; 'nov': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'received:org': 0.40; 'upgrading': 0.60; 'introduced': 0.61; 'here:': 0.62; 'our': 0.64; 'more': 0.64; 'charset:windows-1252': 0.65; 'here': 0.66; 'believe': 0.68; 'production': 0.68; 'invalid': 0.68; 'upgrade,': 0.84; 'choice.': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: parsing tree from excel sheet Date: Thu, 29 Jan 2015 21:59:47 +0000 References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-92-24-222-48.ppp.as43234.net User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 In-Reply-To: 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: 53 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422568807 news.xs4all.nl 2943 [2001:888:2000:d::a6]:57956 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:84847 On 29/01/2015 21:32, alb wrote: > Hi MRAB, > > MRAB wrote: > [] >>>> SyntaxError: invalid syntax >>>> debian@debian:example$ python3 export_latex.py doctree.csv >>>> File "export_latex.py", line 36 >>>> yield from child.show2() >>>> ^ >>>> SyntaxError: invalid syntax >>> >>> and I've tried with both python and python3 (see below versions). >>> >>> debian@debian:example$ python >>> Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40) >>> [GCC 4.4.5] on linux2 >>> Type "help", "copyright", "credits" or "license" for more information. >>>>>> >>> debian@debian:example$ python3 >>> Python 3.1.3 (r313:86834, Nov 28 2010, 11:28:10) >>> [GCC 4.4.5] on linux2 >>> Type "help", "copyright", "credits" or "license" for more information. >>>>>> >>> >>> Is it an issue related to my installation? Shall I upgrade and/or >>> downgrade? >>> >> "yield from" was introduced in Python 3.3. >> > > Ok, that either means I need to upgrade to 3.3 or need to modify the > snippet to a suitable syntax that would work with other versions. > > Considering that upgrading is something that I'm not keen to do on my > production system I believe I've only have one available choice. > > It seems I could use the generator and iterate with .next() in python > 2.6, at least from what I found here: > http://stackoverflow.com/questions/1756096/understanding-generators-in-python > > Al > I'd be inclined to upgrade, see here https://www.python.org/dev/peps/pep-0380/#formal-semantics for why :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence