Skip to content
Advertisement

Tkinter: keep update a variable

I really need help, my brain is melting because of this problem. I’ve studied python for 2 months maybe and I’m not very expert in programming. I’ve got an issue… I’m using tkinter on this program; in this small GUI I’d like to always keep updated the global variable “temp”, and its value should change everytime I click on the button. I know that mainloop() is a blocking method, so it is possible to do something like this?

JavaScript

Thank for the help!

Advertisement

Answer

If you want to print it in the terminal, modify your getvalue function.

Code:

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