Dear all,

Currently I am facing the problem on getting the resources for getting Tkinter and pygame to work together. Sadly, I do not have any leads til now(Which worries me alot!! :( ) so I hope the people here can point me to the correct direction. So basically I want to do something like this...


the latest research development is these two links..

I think the closest is this...
and ... auto&tl=en :?:

but I am not very sure on how to make it work...

Really appreciate it if someone can point me to the correct direction..:|

from tkinter import *
import pygame
import random
import os
root = Tk()
embed = Frame(root, width=640, height=480)
os.environ['SDL_WINDOWID'] = str(embed.winfo_id())
os.environ['SDL_VIDEODRIVER'] = 'windib'
screen = pygame.display.set_mode((640,480))
while True:
    #your code here

Try this. I've used it before, and it works quite well.

The two different eventloops don't work very gracefully together. There is a lot of flickering. Threading might improve performance?

The only thing that works reasonably well is the pygame.mixer and Tkinter to play sounds in a Tkinter application.

This question has already been answered. Start a new discussion instead.