Running external module and accessing the created objects

Kene Meniru Kene.Meniru at
Tue Mar 12 02:58:07 CET 2013

Dave Angel wrote:

> On 03/11/2013 07:57 PM, Kene Meniru wrote:

> I hope you're just kidding.  execfile() and exec() are two of the most
> dangerous mechanisms around.  import or __import__() would be much
> better, as long as your user hasn't already run as his script.

Tried __import__ and it seems to execute the just like execfile  
however it only provides access to objects defined in the module 
only. Like I mentioned, my program has multiple packages and the objects 
myappwin needs access to are stored in an object in another module called

- provides the functions used to describe 3D objects
- is imported into and is called by the functions after they 
create the 3D objects.
- uses another module called which imports to save the 
objects in a class with a dictionary.
- myappwin needs to access the dictionary in the class inside the doc 

KeMeniru at

More information about the Python-list mailing list