Skip to content

Instantly share code, notes, and snippets.

@pzp1997
Created January 28, 2014 01:02
Show Gist options
  • Save pzp1997/8660577 to your computer and use it in GitHub Desktop.
Save pzp1997/8660577 to your computer and use it in GitHub Desktop.
from time import sleep
s = 0
m = 0
h = 0
while True:
if len(str(s)) == 1:
strs = "0" + str(s)
elif len(str(s)) > 1:
strs = str(s)
if len(str(m)) == 1:
strm = "0" + str(m)
elif len(str(m)) > 1:
strm = str(m)
if len(str(h)) == 1:
strh = "0" + str(h)
elif len(str(h)) > 1:
strh = str(h)
print(strh + ":" + strm + ":" + strs)
s+=1
if s>=60:
s = 0
m+=1
if m>=60:
m=0
h+=1
sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment