I have a program which involves several classes as frames in tkinter
. I have a separate file that uses pygame
and is a chess game. I want to be able to load this file up and execute it when I press a certain tkinter
button in one of the frames and to then close this file. I am aware that importing the module at the beginning of the tkinter file runs it immediately which is not what I need. I only want it to run when the button is pressed.
I have attempted to use other modules which do not work. I have tried using functions which also did not work.
I expect to be able to run the chess file when the button is pressed, instead of immediately as this holding file is ran. However, when run the chess file executes immediately and this other file does not even run.