Output to the same line overwriting previous

前端 未结 4 681
醉话见心
醉话见心 2020-11-27 06:02

how to get output to the same line by overwriting previous received Timing(countdown) by NTP server. As shown below after each second timing is receiving in next row.

<
4条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 07:05

    Works in python3

    But only for windows

    import os
    import time
    while True:
        print(time.ctime())
        time.sleep(1)
        os.system('cls')
    

提交回复
热议问题