Reload python modules

   10998   4   0
User Avatar
Member
15 posts
Joined: April 2008
Offline
Hi!

I make a python modules with external editor, and import this modules with “import my_module”. I have a problem when I modify the file *.py. Houdini does not detect this changes. For apply the changes I need restart Houdini.

Does some function exist like reload or similarly?

Thanks and sorry for my english
User Avatar
Member
1906 posts
Joined: Nov. 2006
Offline
All you need to do is reload(modulename)
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
15 posts
Joined: April 2008
Offline
uff, Thank you very much, I'm a bit stupid
User Avatar
Member
859 posts
Joined: Oct. 2008
Offline
Old post but similar problem.

I have a module like this:

from somewhere import something

How do I reload this?
--
Jobless
User Avatar
Member
17 posts
Joined: May 2017
Offline
#Python 3
import importlib
importlib.reload(module)
# Python 2 uses the method mentioned above.
  • Quick Links