I have a foo.py
foo.py
def foo(): print \"test\"
In IPython I use:
In [6]: import foo In [7]: foo.foo() test >
In addition to gnibbler's answer:
This changed in Python 3 to:
>>> import imp >>> imp.reload(foo)
As @onnodb points out, imp is deprecated in favor of importlib since Python 3.4:
imp
importlib
>>> import importlib >>> importlib.reload(foo)