Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'explicitly': 0.04; 'subject:How': 0.09; 'python': 0.09; 'block.': 0.09; 'information?': 0.09; 'subject:command': 0.09; 'subject:while': 0.09; 'subject:python': 0.11; 'language': 0.14; 'sat,': 0.15; 'anyways,': 0.16; 'oct': 0.16; 'semicolon': 0.16; 'wrote:': 0.17; 'statement': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; "d'aprano": 0.29; 'separated': 0.29; 'statements': 0.29; 'steven': 0.29; 'gets': 0.32; 'url:python': 0.32; 'could': 0.32; 'right?': 0.33; 'to:addr:python-list': 0.33; "can't": 0.34; 'subject:?': 0.35; 'url:org': 0.36; 'subject:" ': 0.36; 'anything': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'url:docs': 0.38; 'received:10': 0.38; 'to:addr:python.org': 0.39; 'where': 0.40; 'content-disposition:inline': 0.60; 'link': 0.60; 'thomas': 0.62; 'provide': 0.62; '8bit%:21': 0.69; 'received:10.94': 0.84; 'subject: -': 0.84; 'url:reference': 0.84; '\xe2\x80\x9cthe': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uni-mainz.de; i=@uni-mainz.de; q=dns/txt; s=ironport; t=1350117768; x=1381653768; h=date:from:to:subject:message-id:references:mime-version: content-transfer-encoding:in-reply-to; bh=ynb+Zi0hl8zSTGkww4Z1tUjUGyS1A2PWCtJzTiDRDLQ=; b=d6WjYvfqqPDzPjGem9fDgZjP/cqMnNzQpyeDNdFRUk2Sm8jGRiVJ/qOY 8VzV9mCEswAOjCGCsZZ+BJX/rYC9+5GKM4EgyOkNwluLcF1scWolV73ht f/5tvucgQgW2RPoWuN/+PTTEezflaIBrWLW1tAUELKtirc4piihKJ+BFw w=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4EAEQoeVAKXgZQ/2dsb2JhbABEhhK6YoIgAQEFIw8BVgsYAgImAgIUKQoWiBsHqQuSPoEhijiDHIIPMmADlWsBgRWPG4JvghU Date: Sat, 13 Oct 2012 10:41:32 +0200 From: Thomas Bach To: Subject: Re: How to use "while" within the command in -c option of python? References: <5078b6a9$0$6574$c3e8da3$5496439d@news.astraweb.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5078b6a9$0$6574$c3e8da3$5496439d@news.astraweb.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [88.69.178.148] 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: 1350117769 news.xs4all.nl 6876 [2001:888:2000:d::a6]:36927 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:31189 On Sat, Oct 13, 2012 at 12:32:41AM +0000, Steven D'Aprano wrote: > > He gets SyntaxError because you can't follow a semicolon with a > statement that begins a block. Can someone provide a link on where to find this type of information? I was just hunting through “The Python Language Reference” and could not find anything explicit. The only thing I found is http://docs.python.org/reference/simple_stmts.html “Several simple statements may occur on a single line separated by semicolons.” Anyways, this does not explicitly say “You shall not put a compound statement after a simple statement separated by a semicolon.”, right? Regards, Thomas Bach.