A clock, in python!

So, I decided to try to learn how to do…
A simple clock!

import time
def clock():
    try:
        while True:
            current_time = time.strftime('%I:%M:%S' )
            print(current_time, end='\r', flush=True)
            time.sleep(1)
    except KeyboardInterrupt:
        print('\nGoodbye, my friend.')
clock()            

It really does make me kind of depressed, and happy at the same time with how proud I am of this.

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *