Re: Importing Module To Use Variables In A Second Module

2007-09-28 Thread Calvin Spealman
Most problems like this are caused by trying to access the attributes of the module before that module is fully executed, and thus before they are defined. For example, if you have A.py: import B data = "TEST" And B.py: import A print A.data Now, if you run A,py, it will import B before

Re: Importing Module To Use Variables In A Second Module

2007-09-27 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On 2007-09-27, Steve Holden <[EMAIL PROTECTED]> wrote: > >> Self-evidently you are *not* creating the variables you think you are in >> the variablePage module. Have you tried an interactive test? Try this at >> the interpreter prompt: >> > import variablePage >

Re: Importing Module To Use Variables In A Second Module

2007-09-27 Thread rshepard
On 2007-09-27, Steve Holden <[EMAIL PROTECTED]> wrote: > Self-evidently you are *not* creating the variables you think you are in > the variablePage module. Have you tried an interactive test? Try this at > the interpreter prompt: > > >>> import variablePage > >>> dir(variablePage) > > and you wil

Re: Importing Module To Use Variables In A Second Module

2007-09-27 Thread Steve Holden
[EMAIL PROTECTED] wrote: > I'm stymied by what should be a simple Python task: accessing the value of > a variable assigned in one module from within a second module. I wonder if > someone here can help clarify my thinking. I've re-read Chapter 16 (Module > Basics) in Lutz and Ascher's "Learning

Importing Module To Use Variables In A Second Module

2007-09-27 Thread rshepard
I'm stymied by what should be a simple Python task: accessing the value of a variable assigned in one module from within a second module. I wonder if someone here can help clarify my thinking. I've re-read Chapter 16 (Module Basics) in Lutz and Ascher's "Learning Python" but it's not working for