From: marcel.lanz at isoe.ch (Marcel Lanz)
Date: Sat, 10 Apr 1999 18:47:58 +0200
Subject: Problems with InteractiveInterpreter
Message-ID: <370F80BE.30B889A9@isoe.ch>
X-UID: 1175                                                  

Hi,

I have a modified python shell and I would use processing python code
with the InteractiveInterpreter class.
Now, I've got the following error, if I try to run some codelines with
this Interpreter:

Output:
---------------------------------------------
lanzm at frodo:~/data/projects/pylip > python interp.py 
  File "<input>", line 1
    print i
    ^
SyntaxError: invalid syntax
---------------------------------------------
interp.py:
---------------------------------------------
from code import InteractiveInterpreter

lines = open('test2.py', 'r').readlines()

ii = InteractiveInterpreter()
for line in lines:
 ii.runsource(line)
---------------------------------------------
test2.py:
---------------------------------------------
#!/usr/local/bin/python
#
# test, marcel.lanz at gmx.net
#
# --------------
# File: $Source$
# --------------
# $Log$
#

for i in 'hello':
 print i
----------------------------------------------

any ideas?

marcel




