How to I restart an interactive session?

Diez B. Roggisch deetsNOSPAM at web.de
Fri Mar 18 14:49:32 EST 2005


markscottwright wrote:

> 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?

You can't unload modules, or at least reload is not always working properly.
So - you'd gotta go the road IDLE has gone before I assume.
-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list