[IPython-dev] %bg %run -i foo.py

Gael Varoquaux gael.varoquaux at normalesup.org
Fri Nov 10 03:57:05 EST 2006


It seems this doesn't work. I am missing an obvious way to do this.
Elsewhere this would definitely be a nice feature to add.

Another nice magic to add would be a way to reload a module in a brutal
way. Let me explain. I have all the functions that I use often for
interactive work in a few modules. Every once so ever I change one of
them. Of course as I am a bad boy, I have imported this module doing a
"from foo import *", so I cannot reload it using "reload(foo)". The best
way I have found to reload it is something like

import foo
%run -i foo.__file__ 
# Well, this doesn't work, you have to copy and paste foo.__file__ here,
# as %run cannot take python variables as arguments.

I don't know whether I am clear on that, and I don't know if I am the
only one who needs such a magic but I for one would love to see this in
ipython.

Cheers,

Gaël



More information about the IPython-dev mailing list