Skip to content

Tag: tkinter

KeyError for multiframe tkinter?

I keep getting a KeyError and I am unsure why. I added a print statement and printed the self.frames dict to ensure that the keys existed, and it appears they do. I’m new to using classes to create multi frame apps so any insight would be helpful. The error: The dict that prints: The code where the erro…

how can i show the front cover image of an audio file

I am working on a music player program, i wanted to show the song default image while playing it, so how can I add and show it in a Tkinter window. this what i have tried: Output: this helped me to get all the information about its cover image but i wanted to show it in my Tkinter window. Answer

Issue with folder path in tkinter (python)

I am having an issue of finding the bug in my code in relation to the folder path using filedialog. I have the following code The following error shows up: Answer To use you have to first create global doesn’t create variable but it is only used in function to inform this function to use external/global…

Why is this tkinter program freezing?

I’m having an issue with my GUI freezing, and I don’t know why. The run method is not releasing the lock. Demo program Problem Spam-clicking the progress bar freezes the program. Attempts at debugging I used mttkinter by adding import mttkinter to the import statements and the problem persists. Th…

Determine which widget triggers the callback function in command

I am coding a GUI in python using tkinter. I assgined the same callback function to the “command” argument in 3 buttons. The purpose of these buttons is to specify a directory depending on the widget name. Is there any way that I can tell which widget triggered the callback function, and assign di…

Tkinter button color flashing for no reason

I’m making a refresh function to change the color of a button in tkinter, the problem is that this color must come from another function that returns a string and everytime I update everything flashes for a moment. I’ve tried using StringVar() and only update the color without updating the whole l…