[IPython-user] restart (as in IDLE)?

Fernando Perez Fernando.Perez at colorado.edu
Thu Feb 17 12:48:29 CST 2005


David S. wrote:
> Sometimes I need to start with a clean slate because of side effects of a %run
> or whatever.  Is there an analog to IDLE's CTRL-F6 restart?  

ipython has a %reset command.  Note, however, that it's fairly primitive. 
Doing a full restart of the python state is not trivial, and I haven't tried 
very hard.  For example, I do not purge sys.modules, which means that you'll 
still have to manually reload() any modules which may have changed.

Given Python's rather complex internal status, and the fact that ipython is 
itself a python program running on top of the python interpreter, which is 
simultaneously trying to fake a user-level 'clean' interpeter, this is not an 
easy problem.  I haven't looked at how Idle does things, and whether they 
actually run a separate process for the user-level namespace.  This would make 
many things much, much, easier, and this is the model that ipython is going to 
evolve towards.

Regards,

f




More information about the IPython-user mailing list