A Little Something I Made

To assist myself at work I wrote a little Python script to run as a timer. This is a two fold thing, 1. I’m learning Python, 2. I needed a timer to help track the tests I run at work.

After some hunting and kvetching on Twitter I was guided to some useful resources and came up with the following.


# a simple countdown timer in python
# learning by doing - eh

# time.sleep and import time - http://stackoverflow.com/questions/3309664/python-timer-countdown
#while loop info from - http://thenewboston.org/watch.php?cat=36&number=25

import time

t = input ("How long is the test: ")
station = raw_input ("Which test station is running? ")

while t >0:
print t, "seconds left"
t -=1
time.sleep(1)
print "Test on", station, "complete."

Not very complex and it currently only runs in the command line. My next goal is to make it store the inputs so that it can re run the timer with only one command.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.