Spawning an interactive interpreter in a running python process?

Lie Ryan lie.1296 at gmail.com
Sat Dec 12 10:40:38 EST 2009


On 12/12/2009 3:49 PM, Tim Chase wrote:
>>  I'm curious, in an academic sense, if it's possible to spawn the
>> interactive interpreter (>>>) in a running python application. Ideally, I
>> would like to be able to access the modules, functions and variables the
>> application can.
>>
>> Is something like this possible?

you can also use the -i switch to start the interactive interpreter once 
the script reaches execution:
$ python -i myprogram.py
program output
 >>> # names that are not been deleted at the end of program execution
 >>> # can be accessed here
 >>>




More information about the Python-list mailing list