Simple python question.
When in interactive mode, I'm test an imported file, let's say I use:
from foo import foo
But in the same time I edit the code. How can I update the script which is once loaded into interactive python? When I try to reimport it, nothing happens and I'm still on my old files.
Thanks for any help.
EDIT: Ok, as I understand reload(modulename) works fine, but... What if I'm trying to reload a class with its methods? As it's written in documentation:
If a module instantiates instances of a class, reloading the module that defines the class does not affect the method definitions of the instances — they continue to use the old class definition. The same is true for derived classes.
But there's no word how to update a class methods. Any idea?
The answer's here How to reload the code of a method of class object in Python?
No more question as everything works fine now :)