I am creating some code that updates your clock infinitely. I am using the datetime module currently.
import datetime as dt
def local_time():
def time_check(t):
if t < 10:
t = "0{}".format(t)
else:
t = t
return t
p = dt.datetime.now()
hour = p.hour
minute = p.minute
second = p.second
hour = time_check(hour)
minute = time_check(minute)
second = time_check(second)
local_time = '{}:{}:{}'.format(hour, minute, second)
print(local_time)
for i in range(9999999999999999999):
local_time()
delete_last_line_function()
The time_check()
function is used to turn the hour, minute, and second into 24-hour time format.
The problem I am having is that I am trying to delete the previous line, then fill it in with the new updated time.
Obviously, delete_last_line_function()
doesn't exist. I am using it as a place holder.
Does anyone have any way of delete the previous line?