Skip to content
Advertisement

Tkinter: How to swich label text using buttons

JavaScript

I want to change the label text to the button´s name when I press it. there are undefined buttons so I can’t save each one to a variable.

JavaScript

Advertisement

Answer

You have many errors. Here is a version of your code, for Python 3, not Python 2, that at least runs. It may not do exactly what you want it to do, but it works, and it’s a better starting point than what you posted. The modified code is as follows:

JavaScript

You should do a diff comparison between your code and this version to see the changes.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement