Re: [Tutor] Error Using exec to Run Module Files

2010-08-18 Thread Alan Gauld
wrote exec(open('script1.py').read()) Traceback (most recent call last): File "", line 1, in File "", line 1 %!PS-Adobe-3.0 ^ SyntaxError: invalid syntax What is going on/ Looks like your script1.py file is actually a postscript file. exec expects to see valid Python code, it can'

Re: [Tutor] Error Using exec to Run Module Files

2010-08-17 Thread Knacktus
Am 18.08.2010 06:54, schrieb mes...@juno.com: 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 fo

[Tutor] Error Using exec to Run Module Files

2010-08-17 Thread mes...@juno.com
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