I found another solution.
I used a ToggleButton and .get_active() method
to get the state of a button.
User Profile
Collapse
-
How to initialize a variable only one time when program starts
For example I have a button and I would like to use it to turn something on and off with the same button.
So I thougt, I would use some wariable which woild keep track of the state, but I can't seem to make it work.
I would need to initialize X to value 0, but that initialization should happen only once when the program starts.
x = 0 -> (this part should happen only when program is started)
if x == 0:
...
No activity results to display
Show More
Leave a comment: