Question about import and namespace

jdemoor at gmail.com jdemoor at gmail.com
Fri Sep 1 07:21:41 EDT 2006


Hi,

I'm new to Python and have the following problem :
I have an application started by a main.py file, which does a ' from
module_1 import * '.
main.py is responsible from the creation of an object which is then
used in module_1.
What is the best way to make that object visible in the module_1
namespace ?
I guess that if I do an ' import module_1 ', I can make the object
visible with ' module_1.myObject = myObject ', but that won't work with
the from ... import * statement.

Thanks in advance for your help.




More information about the Python-list mailing list