[Tutor] Error Using exec to Run Module Files

mesrod at juno.com mesrod at juno.com
Wed Aug 18 06:54:22 CEST 2010


I'm a rank beginner in Python.  Took advantage of the O'Reilly one-day sale of 'Learning Python' announced on the tutor, and starting to work my way through it.  When I tried out an example from pg57, on Using exec to Run Module Files, I get the following result:
>>> exec(open('script1.py').read())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1
    %!PS-Adobe-3.0
    ^
SyntaxError: invalid syntax

What is going on/
Gene R.



More information about the Tutor mailing list