Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31176

Re: How to use "while" within the command in -c option of python?

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 <animelovin@gmail.com>
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 <animelovin@gmail.com>
To Herman <sorsorday@gmail.com>
Subject Re: How to use "while" within the command in -c option of python?
In-Reply-To <CANOe_mhhn31Qb2iB1nWydWSm=MJ0xK0o5vxWR+mLeO5ggqwmwQ@mail.gmail.com>
References <CANOe_mhhn31Qb2iB1nWydWSm=MJ0xK0o5vxWR+mLeO5ggqwmwQ@mail.gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2101.1350083051.27098.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Fri, 12 Oct 2012 15:51:19 -0700
Herman <sorsorday@gmail.com> wrote:

>  python -c "import os; while True: print('hello')"
>  File "<string>", 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.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: How to use "while" within the command in -c option of python? Etienne Robillard <animelovin@gmail.com> - 2012-10-12 19:04 -0400
  Re: How to use "while" within the command in -c option of python? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-13 00:32 +0000
    Re: How to use "while" within the command in -c option of python? Thomas Bach <thbach@students.uni-mainz.de> - 2012-10-13 10:41 +0200
    Re: How to use "while" within the command in -c option of python? Chris Angelico <rosuav@gmail.com> - 2012-10-13 20:03 +1100
    Re: How to use "while" within the command in -c option of python? Chris Angelico <rosuav@gmail.com> - 2012-10-14 04:23 +1100
      Re: How to use "while" within the command in -c option of python? Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2012-10-13 20:43 +0300
        Re: How to use "while" within the command in -c option of python? Chris Angelico <rosuav@gmail.com> - 2012-10-14 04:47 +1100
    Re: How to use "while" within the command in -c option of python? Chris Angelico <rosuav@gmail.com> - 2012-10-14 05:41 +1100
    Re: How to use "while" within the command in -c option of python? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-10-13 15:19 -0400
    Re: How to use "while" within the command in -c option of python? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-10-13 16:42 -0400
    Re: How to use "while" within the command in -c option of python? Chris Angelico <rosuav@gmail.com> - 2012-10-14 08:39 +1100
    Re: How to use "while" within the command in -c option of python? Chris Angelico <rosuav@gmail.com> - 2012-10-14 09:09 +1100

csiph-web