Skip to content
Advertisement

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 error occurs: Answer

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 variable when you use

Is there a way to make a object follow another object?

So, I have been working on a project for a very basic Space Invaders. But, I can’t seem to get the Bullet (see code) class to follow the Jet class(see code): I have already searched some websites (and yours, too) and couldn’t find anything. Do I have any way to make the classes follow each other? Answer You could do

Why won’t Tkinter executable capture key combinations?

I’m building an tkinter app on Python 3.7 and creating an .exe with Pyinstaller 3.5 in Windoows 10. When running the code from the IDE, all intended keyboard commands work as expected. However, in the executable, key combinations do not work while single key presses are fine. Here is some test code that demonstrates the problem: Pyinstaller is then invoked

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. The issue is the lock not being released. I inserted print

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 directory in the callback accordingly? (of course,

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 layout but it would just get stuck in the

Advertisement