要如何在同一行顯示?
要如何在同一行顯示? 如計時器的顯示方式,數字自動增加而不跳行?08:46:30 等待1秒30會自動變31 32 33 34
而不是跳行顯示
08:46:30
08:46:31
08:46:32
08:46:33
程序代码:
import time while True: localtime = time.localtime() time1 = time.strftime("%I:%M:%S", localtime) time2 = time.strftime("%M", localtime) print(time1) if time1 == '06:00:00'or time1 == '12:00:00': break else: time.sleep(1)