Dick Moores | 16 Jul 23:02

Does IPython have a "restart"?

I  mean something equivalent to what you get when you do a Ctrl+F6 in IDLE:

>>> import math
>>> math.log(3)
1.0986122886681098
>>> =============================================== RESTART ===============================================
>>> math.log(3)

Traceback (most recent call last):
  File "<pyshell#9>", line 1, in <module>
    math.log(3)
NameError: name 'math' is not defined
>>>

Thanks,

Dick Moores
Fernando Perez | 16 Jul 23:30

Re: Does IPython have a "restart"?

On Wed, Jul 16, 2008 at 2:03 PM, Dick Moores <rdmoores <at> gmail.com> wrote:
> I  mean something equivalent to what you get when you do a Ctrl+F6 in IDLE:

Use %reset:

In [1]: import math

In [2]: math.sin(3)
Out[2]: 0.14112000805986721

In [3]: %reset
Once deleted, variables cannot be recovered. Proceed (y/[n])?  y

In [5]: math.sin(3)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)

/home/fperez/Desktop/≤ipython console> in <module>()

NameError: name 'math' is not defined

Note that it is  NOT the same though: idle forces a new, fresh python
process, while ipython just clears your current variables.  So things
like reloading extension modules won't work the same way.

Cheers,

f

Gmane