Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder7.xlned.com!news2.euro.net!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.03; 'subject:How': 0.09; 'python': 0.09; 'os;': 0.09; 'subject:command': 0.09; 'subject:while': 0.09; 'cc:addr:python- list': 0.10; 'subject:python': 0.11; '"import': 0.16; 'afaik.': 0.16; 'herman': 0.16; 'oct': 0.16; 'received:209.85.216.53': 0.16; 'syntaxerror:': 0.16; 'tabs': 0.16; 'true:': 0.16; 'string': 0.17; 'wrote:': 0.17; 'import': 0.21; '"",': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header :In-Reply-To:1': 0.25; 'url:mailman': 0.29; 'fri,': 0.30; 'error': 0.30; 'url:python': 0.32; 'file': 0.32; 'url:listinfo': 0.32; 'received:google.com': 0.34; 'subject:?': 0.35; 'received:209.85': 0.35; 'message-id:@gmail.com': 0.36; 'url:org': 0.36; 'subject:" ': 0.36; "didn't": 0.36; 'charset:us-ascii': 0.36; 'received:209': 0.37; 'received:209.85.216': 0.37; 'subject:: ': 0.38; 'header:Received:5': 0.40; 'url:mail': 0.40; 'your': 0.60; 'header :Message-Id:1': 0.62; 'received:96': 0.62; 'subject: -': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; bh=Sy4OJcLGLX56IMYuaDJKyiA0u6fn6zmKDHgYdlkY0K4=; b=STxwmr3mIOn1Rq1biW+oCVTkbWWgY/NlWgxGNRi9ffPwGCLLAM22m94SP85WGRqVS7 DxfnJtwdEDHe0Gq1iJSTtx6jBYpkgx1li7qKEw2Hx7UaEYOaFQ21yHyYSwCsg9hIcpt/ ilF07a05GDHYoFFOf+Ue/vR1jxXINb7lVP6w3H2CGUMoj6f2XoqE0z2QqHdjb/7Iiqpr Sis7f02Vv0XLS55f6Z8QC3gzaBZvgEotzSYxD9SNZ8W+r044P6kgGQDQcp+xv0doh2Fs pTvPIQ2M95dCg7p3bla5HeLhVF+OhoBQGx4dP1WOzI+Kh5LlZ5jkPziQgXr1Twwq9viM I6lQ== Date: Fri, 12 Oct 2012 19:04:20 -0400 From: Etienne Robillard To: Herman Subject: Re: How to use "while" within the command in -c option of python? In-Reply-To: References: X-Mailer: Sylpheed 3.2.0 (GTK+ 2.24.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: python-list@python.org 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1350083051 news.xs4all.nl 6913 [2001:888:2000:d::a6]:50826 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:31176 On Fri, 12 Oct 2012 15:51:19 -0700 Herman wrote: > python -c "import os; while True: print('hello')" > File "", line 1 > import os; while True: print('hello') > ^ > SyntaxError: invalid syntax > -- > http://mail.python.org/mailman/listinfo/python-list You get a syntax error since you didn't used tabs indents in your string which is normal for python AFAIK.