I have two files. One is interface.py (Tkinter code) that contains the interface of the application. Another file is logic.py. The interface contains a button. What I want is that when I click the button the logic.py file starts its execution. How can I perform this task?
The easiest way is to use main function inside the file you want to execute, and then to call it (import logic, then Button(command=logic.main).pack()) or to use __import__ or import logic inside the button command function.
How to call or execute new file when a button is clicked in tkinter