Answer the question
In order to leave comments, you need to log in
Why isn't the Tkinter text widget updating?
When I try to run a window opens, but the value is not updated, it throws an error (TypeError: 'Label' object is not callable)
Here is the script:
from tkinter import *
import wmi
window = Tk()
window.title("...")
window.geometry('450x250+1455+5')
window.attributes("-topmost",True)
window.resizable(width=False, height=False)
w = wmi.WMI(namespace="root\\OpenHardwareMonitor")
temperature_infos = w.Sensor()
sl = {}
for sensor in temperature_infos:
sl[sensor.Name] = sensor.Value
fan_gpu = sl['GPU']
fan_gpu_info = Label(text= f'{fan_gpu} RPM')
fan_gpu_info.place(relx=.0, rely=.0)
def fans_gpu():
sl = {}
for sensor in temperature_infos:
sl[sensor.Name] = sensor.Value
fan_gpu = sl['GPU']
fan_gpu_info.config(text=f'{fan_gpu} RPM')
fan_gpu_info.after(1000, fan_gpu_info)
fans_gpu()
window.mainloop()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question