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

Thomas Bach thbach at students.uni-mainz.de
Sat Oct 13 04:41:32 EDT 2012


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.



More information about the Python-list mailing list