[capi-sig] Python parser

Pablo Yabo pablo.yabo at gmail.com
Tue May 27 21:52:47 CEST 2008


Hello,

I embedded Python in an application to play with some objects.
I want to add some features to my console and I don't find how to evaluate
in the same way the Python console does.

I want to let the user insert a:
for a in [1,2,3]:

and I want to put the '...' like the console but if I evaluate the 'for a in
[1,2,3]:\n' using PyRun_SimpleString I get an error:

  File "<string>", line 1
    for a in [1,2,3]:
                   ^
SyntaxError: unexpected EOF while parsing

Is there any way to evaluate in the same way the console does?

Thanks in advance,
Pablo Yabo


More information about the capi-sig mailing list