python -c strangeness

Brian Gough bjg at network-theory.co.uk
Mon May 10 04:49:25 EDT 2004


Miki Tebeka <miki.tebeka at zoran.com> writes:

> [09:10] - adp86: python -c 'import sys; for i in range(3): print i'
>    File "<string>", line 1
>      import sys; for i in range(3): print i
>                    ^
> SyntaxError: invalid syntax

Simple statements can be separated with a semicolon, but a compound
statement (e.g "for") must begin on a new line.  See the language
reference manual for the full grammar of Python.

-- 
Brian Gough

Network Theory Ltd,
Publishing the Python Manuals --- http://www.network-theory.co.uk/



More information about the Python-list mailing list