timer

| | Add comment | Trackbacks (0) | Next | Previous

#timer.py
 
 
import pygame, time, sys
p = map(int, ''.join(sys.argv[1:]).split(':'))
s = p.pop()
if p: s += p.pop()*60
if p: s += p.pop()*3600
time.sleep(s)
pygame.mixer.init(11025)
pygame.mixer.Sound('d:\\utils\\ringin.wav').play(1)
time.sleep(10)
 

and a batch file that goes..

@echo off
@echo current time is %TIME%
start d:\python26\pythonw \utils\timer.py %*

example:

D:\>timer 4:00
current time is  5:41:52.74
D:\>timer 4
current time is  5:41:56.07
D:\>timer 4:10:00
current time is  5:42:05.34

Comments

Add comment
 authimage