> > Yes, that works indeed. But in practice the modules_to_import list is > filled by parsing the contents of a test/*.py directory. That's why I > import dynamically with __import__. > > Nevertheless, you got me on the right track. After I explicitly added > the modules to the global namespace (globals()["mytest"] = > __import__("mytest")), it works fine. Thx!
Another way to do it is using imp.load_source, see http://waf.googlecode.com/svn/trunk/test/Test.py Yinon -- http://mail.python.org/mailman/listinfo/python-list