2009-02-13

import time

Today is a special date, well actually an special UNIX date, according to the UNIX calendar -which is measured in seconds after January 1 1970- we are approaching date 1234567890 at precisely 18:31:30.

So in anticipation, let's write a little clock script:


import time
while True:
print int(time.time())
time.sleep(1)

Or if you prefer a countdown clock like myself:


import time
t = True
while t:
t = 123456789 - int(time.time())
print t
time.sleep(1)
else:
print "Happy valentine ^_^!"




0 msgs: