I have a script here that is suppose to use a command to output the temperature of a RPi.
from tkinter import *
import subprocess
win = Tk()
f1 = Frame( win )
while True:
output = subprocess.check_output('/opt/vc/bin/vcgencmd measure_temp', shell=True)
tp = Label( f1 , text='Temperature: ' + str(output[:-1]))
f1.pack()
tp.pack()
win.mainloop()
Since I want to see the temperature change, I tried to make the command repeat itself but it breaks the script. How can I make the command repeat itself so I can have constantly updating temperature?