Oh I was't expecting it to run, it meant to explain the idea of loops but here is one that works.
time =datetime.datetime(100,1,1,0,0,0) # arbitrary day
sunIsSet = True
if(time.hour > 5 and time.hour < 18):
sunIsSet = False
print("time is:",time.time().isoformat(), " it's day time!")
print("time is:",time.time().isoformat()," it's night time!")
time = time + datetime.timedelta(0,1)
oops... the imports killed the simplicity :(
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.