Hi All,
As I am getting a little older, I sometimes take small naps to recharge my batteries:) Is this while loop OK? What kind of error checking should I use?
thanks
-david

<code>

#!/usr/bin/python

import time
import subprocess
import sys

doit = 1
alarmhour = int(raw_input("Please enter the hour. (24h): "))
alarmmin = int(raw_input("Please enter the minute. (01-59) "))

while(doit):
        mytime = list(time.localtime())
        hour = mytime[3]
        minute = mytime[4]
        if hour == alarmhour and minute == alarmmin:
                subprocess.call('mplayer -loop 9 ring.wav', shell=True)
                sys.exit()
doit = 0

</code>
--
Powered by Gentoo GNU/LINUX
http://www.linuxcrazy.com
pgp.mit.edu

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to