Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'syntax': 0.04; 'python3': 0.07; 'subject:parsing': 0.09; 'python': 0.11; 'def': 0.12; '3.1.3': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'received:192.168.1.4': 0.16; 'syntaxerror:': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; "i've": 0.25; '(see': 0.26; '2010,': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'related': 0.29; 'dec': 0.30; '>>>>': 0.31; 'file': 0.32; 'skip:d 20': 0.34; 'subject:from': 0.34; 'yield': 0.36; 'nov': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'to:addr:python.org': 0.39; 'introduced': 0.61; 'more': 0.64; 'here': 0.66; 'invalid': 0.68; 'otten': 0.84; 'peter,': 0.84 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=A/HiPsmG c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=Vhvw94NMJWsA:10 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=oR1syuns5vooUiPXayUA:9 a=QEXdDO2ut3YA:10 X-AUTH: mrabarnett@:2500 Date: Thu, 29 Jan 2015 21:16:57 +0000 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: parsing tree from excel sheet References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed 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: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422566221 news.xs4all.nl 2909 [2001:888:2000:d::a6]:46722 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:84844 On 2015-01-29 21:02, alb wrote: > Hi Peter, > > Peter Otten <__peter__@web.de> wrote: > [] >> def show2(self): >> yield str(self) >> for child in self.children: >> yield from child.show2() > > here is what I get: > >> 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.