[SciPy-User] Reset IPython to original blank state.

Dharhas Pothina Dharhas.Pothina at twdb.state.tx.us
Thu Nov 19 13:41:42 EST 2009


Sorry didn't realize IPython had a separate mailing list. Will repost there.

I think I may have fixed the "too many files" problem but I the big problem I have is when rerunning the same script and having too many legend labels show up in matplotlib plots since it still has the old ones from the previous time the script run.

- d

>>> Robert Kern <robert.kern at gmail.com> 11/19/2009 12:08 PM >>>
On Thu, Nov 19, 2009 at 10:53, Dharhas Pothina
<Dharhas.Pothina at twdb.state.tx.us> wrote:
> Hi All,
>
> I'm trying to do something like matlab's 'clear all; close all; fclose all;' this command basically resets matlab to a blank state by clearing all variables and closing all figures and files. It is hugely useful for avoiding old variables and data interfering with current work when interactively plotting and exploring data.
>
> With Ipython on Linux this is not too big of a deal since I can easily just quit and restart Ipython. On windows Ipython seems to take an inordinate amount of time to start so this is really an issue and causes the workflow to be interrupted.
>
> I've tried using %reset and while that seems to clear any variables in memory it doesn't seem to reset everything. I'm having lots of issues with matplotlib figures and other crashes related to 'too many open file handles' if I do not close and restart Ipython.

Where are these open files coming from? Most of the code in
numpy/matplotlib/IPython should be properly closing files. If it is
your code, it would be worth your time to fix your code to not keep
files open longer than necessary rather than restarting IPython.

> Any way around this. Is there a small script I could use to clear everything and take Ipython back to its original startup state without restarting it?

Not really, no.

Also, you will want to ask further IPython questions on the IPython
mailing list:

  http://mail.scipy.org/mailman/listinfo/ipython-user 

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco
_______________________________________________
SciPy-User mailing list
SciPy-User at scipy.org 
http://mail.scipy.org/mailman/listinfo/scipy-user




More information about the SciPy-User mailing list