On Jun 24, 12:27 am, Terry Reedy wrote:

> > 1) Can I tell Executable.py to share Data with ModuleTest.py?
>
> After the import is complete, yes.
> import ModuleTest
> ModuleTest.Data = Data
>
> This works if the use of Data is inside a function that is not called
> during import, not if the use of Data is at toplevel or in a class
> statement outside a def.

That works! The solution looks like this:

# controlling program:
from Module import Data
import ModuleTest
ModuleTest.Data = Data
ModuleTest.getData()

# module:
def getData():
    print(Data.Plist.Structure)


Thanks for all your help!

-- Gnarlie
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to