Feb-17-2020, 02:04 AM
I want this to reprint and replace the time on the same line but its only printing the last character.
If I take out the
If I take out the
end="\r" it prints the time vertically.from datetime import datetime
import time
def get_time():
now = datetime.now()
current_time = now.strftime("%H:%M")
return current_time
while True:
for i in get_time():
print(i, end="\r") # Only prints last character of get_time().
time.sleep(60)Result:6
