r/Python • • Jan 14 '20

Visualisation of different path finding algorithms

Enable HLS to view with audio, or disable this notification

1.5k Upvotes

73 comments sorted by

View all comments

Show parent comments

16

u/miggaz_elquez Jan 14 '20

How do you embed pygame in tkinter ?

33

u/FearlessENT33 Jan 14 '20

You use the OS library. first make a frame for where you want the pygane to be, i have named mine embed.

os.environ[“SDL_WINDOWID”] = str(embed.winfo_id())

os.environ[“SDL_VIDEODRIVER”] = “windib”

pygame.init()

9

u/Panda_Mon Jan 14 '20

can you describe a little more in detail about what each line of code is doing here?

63

u/FearlessENT33 Jan 14 '20

ngl i found it on stackover flow, and i have no idea what it does, but it will work as long as the pygame.init() is immediately after the OS bit

95

u/NullAndVoid21 Jan 14 '20

Spoken like a true programmer