Dec-30-2018, 03:01 PM
You need to put your code into functions and classes, so that it doesn't run automatically when you import it. So your afairesh module would have a function in it, call it do_something. You would import afairesh at the top of the GUI module, and all it would do is define the afairesh.do_something function. Then, when the correct button is pushed, you would call afairesh.do_something(), and that would run the code.
And on line 72 you use
And on line 72 you use
global popup
. There is no reason to use global within a class. Or at least no good reason, there are lots of bad reasons. Either pass popup to the method directly as a parameter, or make popup an attribute of the class, and use self.popup to refer to it.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures