How to I restart an interactive session?

markscottwright markscottwright at gmail.com
Fri Mar 18 13:42:52 EST 2005


I'm trying to cobble together an IDLE equivalent using pyshell and VIM
(My idea is just to pipe exec file commands from VIM to pyshell via a
socket or something).  The one feature that IDLE has that I would
really like but can't seem to duplicate is the "Restart Shell" command.
 Delving through the IDLE code, it looks like IDLE kills and restarts
its InteractiveInterpreter-derived class to do this.  Is this really
necessary?  If I just take __main__.__dict__ and strip out everything
since a start point, haven't I restored the interpreter to a virgin
state?

(Of course, assuming that there are no threads running, no
c-code-invoked junk lying around, etc).




More information about the Python-list mailing list