Importing Module To Use Variables In A Second Module

Steve Holden steve at holdenweb.com
Thu Sep 27 20:33:47 EDT 2007


rshepard at nospam.appl-ecosys.com wrote:
> On 2007-09-27, Steve Holden <steve at holdenweb.com> 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 will see exactly what names the module is defining in its 
>> namespace. You could also try
>>
>>>>> variablePage.__file__
>> to make sure that you are importing the module you think you are.
> 
> Steve,
> 
>   Many thanks.
> 
>   I _think_ the problem is that the wxPython objects are not instatiated
> when I'm trying to access the variables. Since they are instance variables,
> they just don't exist yet.
> 
>   Learning just when wxPython objects are instantiated is something I've
> just begun to do.
> 
> Rich

That could be. If they are instance variables, however, you will find 
you have to access them as

     variablePage.instancename.attributename

regards
  Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd           http://www.holdenweb.com
Skype: holdenweb      http://del.icio.us/steve.holden

Sorry, the dog ate my .sigline




More information about the Python-list mailing list