This is because both tkinter and pygame require access to the main event loop in order to run properly. However, they each have their own event loops that can conflict with each other.
To solve this problem, there are a few possible solutions:
Use pygame's event loop exclusively and avoid using tkinter's mainloop() function. This can be done using Pygame's event.get() function to handle events.
Use a separate thread for tkinter to run in. This can be done using python's threading module. However, this can make the code more complex and difficult to manage.
Use a different GUI library that is compatible with pygame, such as PyGTK or PyQT. These libraries have their own event loops that can coexist with pygame's event loop.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-04-28 11:00:00 +0000
Seen: 13 times
Last updated: Sep 22 '21