Oct-05-2019, 01:09 PM
It's the same problem just extended a bit. EEG imports Click_Listener, Click_Listener imports Functions, and Functions tries to import EEG, which isn't finished loading yet because it is still trying to import Click_Listener.
This is highlighting why classes and object oriented programming are so useful to GUI programming. You have a function bound to an event, so you don't have control of it's parameters. But you need to access other parts of your GUI from the function. You're trying to do this with imports, so you keep getting circular imports. If the function is part of the same class as the rest of the GUI, it can access the other parts of the GUI using class attributes.
I would really recommend learning OOP and classes before moving forward with GUIs. There are lots of tutorials on this site about classes. I even link to one in my signature.
This is highlighting why classes and object oriented programming are so useful to GUI programming. You have a function bound to an event, so you don't have control of it's parameters. But you need to access other parts of your GUI from the function. You're trying to do this with imports, so you keep getting circular imports. If the function is part of the same class as the rest of the GUI, it can access the other parts of the GUI using class attributes.
I would really recommend learning OOP and classes before moving forward with GUIs. There are lots of tutorials on this site about classes. I even link to one in my signature.
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