[IPython-user] Module reload in interactive mode

Robin robince@gmail....
Mon Feb 9 07:33:47 CST 2009


On Mon, Feb 9, 2009 at 1:26 PM, Ignazio Di	Napoli <neclepsio@gmail.com> wrote:
>>I'm not certain but you could try using run -i
>
> Thank you for your reply. The suggestion does not work: in particular, the functions in a module of the package I'm reloading are resetted ('module' object has no attribure 'funcname').

I'm sorry it doesn't work... actually for me reload / dreload work
fine even with run.

Here is an example:
robin-mbp-3:tmp robince$ cat testscript.py

import testmod

testmod.testfunc()
robin-mbp-3:tmp robince$ cat testmod.py

def testfunc():
    print "This is the original test function"

Ipython session (0.9.1):
In [4]: run testscript.py
This is the original test function
In [5]: reload testmod
------> reload(testmod)
Out[5]: <module 'testmod' from 'testmod.py'>
In [6]: run testscript.py
This is the new test function

(where i changed testmod.py before reloading).
Perhaps you could check your ipython version and give a minimal
example like the above of what doesn't work.

Cheers

Robin


More information about the IPython-user mailing list