I'm having the following problem:
I can get the value of a dynamic variable (checkbutton) when the whole program is in a single file with only one function:
%pre%
However if I separate the code into two files, each one on a screen and two modules, I can only get the 0 values of the checkboxes:
File 1: TwoWindows2
%pre%
File 2: TwoWindows2
%pre%
Can anyone help me with this?
______ azszpr313528 ___
Variables from the other file can be accessed normally if you import the other file - but not with the %code% syntax, and use the filename as a prefix:
For example, you could put all the variables in a file
name %code% and use a line like this
%pre%
And inside that file you can access the variables with %code% and so on.
Your code is pretty messy, but sometimes doing is the only way to learn - I recommend a third file, why else can you
to fall into a problem of circular import dependency, the way it is working.
Another note: The keyword "global" only makes sense within functions - and says that those variables within the function will be visible in that module (file) - (and thus will be visible from the other files using the form prefix, as I showed above): using "global" inside classes and outside functions does not make sense. (It would even make a difference, but one has to know a lot Python to know exactly what it is doing, and even then, it would hardly be the right way to do anything.)
___