python external file refresh

   4547   4   0
User Avatar
Member
338 posts
Joined: 9月 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
1922 posts
Joined: 11月 2006
Online
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: 9月 2006
Offline
Cheers yeah i figured it out right after I posted. DOH!!
Thanks
Nick
User Avatar
Member
4 posts
Joined: 4月 2016
Offline
has something changed with houdini 19.5 and python 3.0 perhaps? this old trick isn't working for me.
User Avatar
スタッフ
407 posts
Joined: 2月 2008
Offline
with python 3 you'll need to first

from importlib import reload
  • Quick Links