On Jan 9, 2008 8:54 AM, Slide <[EMAIL PROTECTED]> wrote: > > If I change this file and try reloading my script, it takes the > modifications just fine and runs the new code. If I modify mymod, but > not the main script, I get the old code from mymod run. Is there > something I can do to force it to reload the imported scripts as well?
There's no straightforward and reliable way to track usage, so the only thing you could do generically is to reload *all* your modules. One thing you could do would be to say "import mymod" in any other module using mymod. After a reload of mymod, you could then iterate over sys.modules and reload any module containing the symbol "mymod". It's not foolproof, but it's probably good enough. Another alternative would be to change your code to look like this: class MyClass(SomeNameSpace.IMyInterface): def SomeFunc(self): from mymod import myfunc myfunc() That way, the import gets re-run each time you run SomeFunc, and you'll always get the latest version of the module. -- Curt Hagenlocher [EMAIL PROTECTED] _______________________________________________ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com