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
[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
>
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
[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
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