How to Re-Import a Module after Modifying or Adding a Function Without Exiting the Interpreter
Posted on 2004-08-31
When I am testing my functions (from, e.g., mymodule.py) in the Python interpreter, and I edit a function or add a new function, how can I re-import the functions without leaving the interpreter?
If I do
>>> from mymodule import *
again, the interpreter does not recognize the changes. If I exit and then restart the interpreter, it will import the latest changes, but then I lose any working variables as well as my command history.
Is there any way around this?
Thanks in advance,