Yes, the title sounds stupid, but hear me out:
I'm trying to make a clock program, and I need the minutes and hours hands to actually 'move' by themselves (as in moving when the minute or hour changes, respectively) by undoing a line and drawing it again, but in a different place. However, instead of that, the hands of the clock go to the right positions right at the start of the program; for example, if you started the program at 2:49, it would put the hands at 2:49. Then, when you reach 2:50 (or any other time, for that matter), the hands stay in the same place, not updating with the time. The weird thing? There are no error messages or anything (this is the reason I made an account on stack overflow)
Here's the relevant parts of the code that I'm using:
import turtle
import datetime
tm_year,tm_mon,tm_mday,tm_hour,tm_min,tm_sec = map(int,time.localtime()[:6])
# I add extra values here to offset it for the next chunk of code
hora = tm_hour+360
minuto = tm_min+360
segundo = tm_sec+360
# I ran out of names for variables in the code so I resorted to español
while True:
if hora != tm_hour:
hour.undo()
hour.seth(90)
hour.rt(30*tm_hour)
hour.fd(20)
hora = tm_hour
if minuto != tm_min:
minute.undo()
minute.seth(90)
minute.rt(6*tm_min)
minute.fd(60)
minuto = tm_min
if segundo != tm_sec:
second.undo()
second.seth(90)
second.rt(6*tm_sec)
second.fd(40)
segundo = tm_sec