Re: Help with use of code.InteractiveInterpreter for multiline code

2004-12-03 Thread Jim Sizelove
[EMAIL PROTECTED] wrote: I'm trying to embed a Python interpreter in a GUI I'm developing, and I'm having trouble understanding the proper use of code.InteractiveInterpreter. [examples of calling the interpreter instance] What's the proper way to call the interpreter instance for a multiline exampl

Re: Help with use of code.InteractiveInterpreter for multiline code

2004-12-03 Thread Jean Brouwers
Take a look at the source code of the code module (file code.py in the lib directory). The push() method of the InteractiveConsole class shows how to handle multi-line statements. Basically, keep collecting lines as long as the result returned by the runsource() call is true. Maybe instead of c