[Sidefx-houdini-list] Python modules scope in Houdini

Pablo Giménez pablogipi at gmail.com
Tue Apr 26 19:43:09 EDT 2011


Hi all.
I have a Python package with several modules which I load using  in my
$HOME/houdini11/scripts/pythonrc.py
Basically I have just one line>
import myPackage
Well this package has a __init__.py script with seveal stataments to
be executed on initialization.
I know that for the same Python session modules are loaded just one
time, so if you import it several times it will keep only the first
intance.
But I am not what is the scope of the Python inerpreter launched by
Houdini. The one you use when you open the Python console.
For instance if I a want to use a function from this package for a
menu script for a parameter I have to import my package again, whereas
if I use it in a Python console I dont need to do it.
So I am wondering if Houdini shares the same python session across all
the places where python can be used, or are situations where the
python session is diferent and a new interpreter is launched.
thanks

-- 
Un saludo
Best Regards
Pablo Giménez



More information about the Sidefx-houdini-list mailing list