[Tutor] Returning a variable from a module

Paul De Luca pdeluca@sia.net.au
Mon, 9 Jul 2001 12:23:02 +1000 (EST)


Yeah, it was just a typo I made when writing the email. I realized it
after I send the email. I Was hoping nobody would notice, but I guess
thats hard considering every single person subscribed to this list is a
programmer. Poor spelling/grammar never seems to go down well with the
open source community. ;)







On Sun, 8 Jul 2001, Patrick K. O'Brien wrote:

> Is that just a typo, or the cause of the problem? Your code should probably
> be:
> 
>     import configlib
>     configlib.get('.gamerc')  # not configlib.import('.gamerc')
> 
> Does the get() function return a value? It probably should return config.
> Then the code would actually be something like:
> 
>     import configlib
>     gamercConfig = configlib.get('.gamerc')
> 
> ---
> Patrick K. O'Brien
> Orbtech
> "I am, therefore I think."
> 
> -----Original Message-----
> From: tutor-admin@python.org [mailto:tutor-admin@python.org]On Behalf Of pd
> Sent: Sunday, July 08, 2001 5:53 AM
> To: tutor@python.org
> Subject: [Tutor] Returning a variable from a module
> 
> <snip>
> 
> It seems to work, but when I save this code into a file called
> configlib.py and try to get values from the variable config. It doesnt
> seem to work.
> 
>                 import configlib
>                 configlib.import('.gamerc')
> 
> This leads to my question: How do I access a variable that I have created
> within a module which I have imported?
> 
> 
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
> 




-------------------------
Paul De Luca
Email: pdeluca@sia.net.au
Ph: 0414 225 561
-------------------------