
June 3rd, 2004, 05:12 PM
|
|
Contributing User
|
|
Join Date: Feb 2004
Location: London, England
|
|
|
If you do
from mymodule import *
then you are copying all the variables into your current namespace. This is generally frowned apon, since it pollutes your namespace and if you then import another module that has variables/classes/whatever of the same name then they will be overwritten.
It sounds to me that what you want to do is:
import mymodule
then you can refer to the variables in it with mymodule.variablename.
Modules are not the same as classes, but are objects in their own right.
Dave - The Developers' Coach
P.S. please learn to use [ code ] tags when putting python code in your posts. Without them the formatting gets screwed up and it can become unintelligible.
|