On 8/13/07, Ori <[EMAIL PROTECTED]> wrote:
>
>
> Thanks but I did not ask if it is ugly or not. I just need it.
> Is there a way to do it?


In my email, I also gave two examples of legal Python code with more than
one statement per line.

In general, you can put any number of commands on the same line using a
semi-colon as separator.  That means that the following is legal Python:

print 'hello'; print 'goodbye'; print 'up'; print down

However, conditional and looping constructs that contain a colon -- that is,
"if", "for", "while", etc. -- are limited to one per line, and the statement
ending in a colon must be the first one on the line.  That is, the first of
these lines is legal Python and the second and third are not.

if 1: print 'goodbye'; print 'hello'
print 'hello'; if 1: print 'goodbye'
if 1: print 'goodbye'; else: print 'hello'

--
Curt Hagenlocher
[EMAIL PROTECTED]
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to