i'm trying rn to give an interface, gui to my code so that it's easier to experience with it, and trying to make one with tkinter rn, the code is alr i just got a problem wit the root.mainloop() which is just blocking my whole code after it, and if i try to put it a the end of my code it's just making the interface showing really late
#๐ tkinter issue
12 messages ยท Page 1 of 1 (latest)
@dapper mason
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
Mainloop blocks everything because it makes the gui listen to events in the current thread. Meaning it's busy. You gotta make another thread to have both gui and something running in the background at the same time
Mainloop is called like that because internally it's literally a loop - loop ends only of the main window closes, otherwise it checks for events (clicking buttons, keys, mouse events, etc), does stuff related to those events... then checks for new events.
yeah thanks, i've seen this but i was just looking for a solution to get my interface working at the same time as my code
so another thread seem a good deal but idek how it works
You gotta learn about threading. Idk what's a good resource for that. I think realpython had some explanation about threading ๐ค but I'm not sure, I've never taught anyone about those, and I learned threads before I learned python...
alr thanks
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.