EXECing multiple lines.

Joonas Paalasmaa joonas at olen.to
Mon Jun 11 15:15:05 EDT 2001


What might be wrong when I get the following error?

>>> exec """for x in range(5):
    print x"""
Traceback (innermost last):
  File "<pyshell#3>", line 1, in ?
    exec """for x in range(5):
  File "<string>", line 2
    print x
          ^
SyntaxError: invalid syntax
>>>



More information about the Python-list mailing list