Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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:

  1. 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.

  2. 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.

  3. 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.