python external file refresh
4621
4
0
-
- niko3d
- 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
-
- graham
- Member
- 1922 posts
- Joined: 11月 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
-
- niko3d
- Member
- 338 posts
- Joined: 9月 2006
- Offline
Cheers
yeah i figured it out right after I posted. DOH!!
Thanks
Nick
-
- Eroc999
- 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.
-
- npetit
- スタッフ
- 413 posts
- Joined: 2月 2008
- Offline
with python 3 you'll need to first
from importlib import reload