Problem with imported variable

carole valentin carole_valentin at yahoo.fr
Thu Nov 1 12:36:18 EST 2001


Hello!

I have a little question:
I have 2 classes "Class1" and "Class2" and several
functions in each class. The Class1 is in the file
"File1" and the Class2 is in another file "File2". At
the beginning of the File1, I import the File2:
from File2 import *

In the Class2, I create a variable with a specific
value. When the program is running, I modify the value
of this variable in the other class (Class1) and then
I want to read the new value of the variable farther
in the code of the Class2.
The problem is that the value does not change in the
File2 (Class2). Moreover, as the 2 classes are not in
the same files, the global statement does not change
the problem.
Does someone have an idea?
Thanks for your help!

Carole.

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Courrier : http://courrier.yahoo.fr




More information about the Python-list mailing list