
Member-only story
Taming Time in Python
So your project demands that you do something with time and you find the subject a little hard to approach ? I’ve been there a few times and so I wanted to write a little about time related things in Python, (mostly to keep track) come along I’ll try my best to make it beginner friendly.

👋👋 Hi there 👋👋 all my content is free for Medium subscribers, if you are already a subscriber I wanted to say thank you ! 🎉 If not and you are considering subscribing, you can use my membership referral link, you will be supporting this and other high quality content, Thank you !⭐️⭐ Subscribe to Medium ! ⭐️⭐️
Measuring time
By that I mean you just want to see time go by in your terminal, this is a script that does just that :
Not much going on here, we just import the time library ( which should be part of your default python install ) and call a few methods:time.strftime To get and format the current timetime.sleep(1) This just tells your script to wait one second before looping back at the while level.You should get a readout in your terminal like:14:39:43
14:39:44
14:39:45
14:39:46
14:39:47
14:39:48
14:39:49To exit the loop just hit Ctrl + C
While the code above does exactly what we want, your end project is probably not a command line time teller, so let’s do a small integration with a GUI, ( I use/recommend PySimpleGUI with some caveats)…