I want to print the current time on screen in hours and minutes that updates automatically without making a new line, as well as print another line with the seconds that also updates automatically on a second line. Thanks in advance! This is what I have so far:
import time
from datetime import datetime
while True:
now = datetime.now()
current_time = now.strftime("%I:%M %p")
current_second = now.strftime("%S")
print("\r" + "Clock: ", current_time, end= ' ')
print("\r" + "\n" + "Seconds: ", current_second, end=' ')
time.sleep(1)
This is what the output looks like: Output
The seconds out like they should, but the time does not