python external file refresh

   4220   4   0
User Avatar
Member
338 posts
Joined: Sept. 2006
Offline
Hey guys,

A quick and pretty simple question. Is there a way to reload a python script after ive imported it into houdini?

I.e

import sopnet

change the external file sopnet.py and import it again to update the changes?

running “import sopnet ” again doesnt do this. So im guessing im missing something.

Thanks
Nick
User Avatar
Member
1907 posts
Joined: Nov. 2006
Offline
reload(sopnet)

When I'm doing work in the same module all the time I like to do something like

import sopnet
reload(sopnet)

That way it will always be refreshed when I am testing things out.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
338 posts
Joined: Sept. 2006
Offline
Cheers yeah i figured it out right after I posted. DOH!!
Thanks
Nick
User Avatar
Member
2 posts
Joined: April 2016
Offline
has something changed with houdini 19.5 and python 3.0 perhaps? this old trick isn't working for me.
User Avatar
Staff
359 posts
Joined: Feb. 2008
Offline
with python 3 you'll need to first

from importlib import reload
  • Quick Links