When any modules is imported (for the first time) it is put into a
dictionary "sys.modules". The module name is the key and the value is an
module object. When a module is imported for a second time the import does a
dictionary lookup first to see if has already been loaded. If the module is
found in sys.modules it returns the module object.
def removeModule(name):
if sys.modules.has_key(name):
del(sys.modules[module])
removeModule("savemanager")
import savemanager as sm
On Mon, Apr 27, 2009 at 6:42 AM, sukuba <[email protected]> wrote:
>
> Hi all,
> anyone have this problem? I've been a while using pyqt in maya, doing
> interfaces with more or less success, but in the last days I've seen
> an strange and annoying behaviour when I reload a module, like this:
>
> import savemanager as sm
> reload(sm)
>
> Maya doesn't reload the module, so the debbuging is imposible and I
> have to close Maya, open it again, and import the module.
> This issue is slowing my work a lot, and I don't know what else to do,
> because I did this reloads before and it used to work.
>
> ¿¿??
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---