My problem is i can not get it to open the file when the alarm goes off. Any help would be greatly appreciated.
Here is the script:
#Alarm where you can set the timer.
#AlarmclockworksV.01
import os, time
print "The current time is:"
print time.strftime("%H:%M:%S")
alarminfo_1 = raw_input("Enter the Hour:")
alarminfo_2 = raw_input("Enter the Minute:")
alarminfo_3 = raw_input("Enter the Second:")
def alarm_exec():
a_1 = alarminfo_1
a_2 = alarminfo_2
a_3 = alarminfo_3
running = True
running1 = True
running2 = True
running3 = True
running4 = True
while running:
print "The timer was set at:"
print time.strftime("%H:%M:%S")
running = False
while running1:
if len(alarminfo_1) == 1:
a_1 = ("0" + alarminfo_1)
running1 = False
if len(alarminfo_1) == 2:
a_1 = alarminfo_1
running1 = False
while running2:
if len(alarminfo_2) == 1:
a_2 = ("0" + alarminfo_2)
running2 = False
if len(alarminfo_2) == 2:
a_2 = alarminfo_2
running2 = False
while running3:
if len(alarminfo_3) == 1:
a_3 = ("0" + alarminfo_3)
running3 = False
if len(alarminfo_3) == 2:
a_3 = alarminfo_3
running3 = False
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#my problem is i can not get it to open that file, i have tried many different ways to get this to work, but im all out of ideas.
while running4:
if time.strftime("%H:%M:%S") == ("%s:%s:%s" % (a_1, a_2, a_3)):
print "Alarm has gone off."
os.open(r'C:\Documents and Settings\Zack\My Documents\My Music\Unknown Artist\Unknown Album (8-9-2006 3-32-51 PM)\01 Track 01.wma')
time.sleep(30)
running4 = False
alarm_exec()
print 'finished'
raw_input("Press Enter to quit.")
Here is the script:
#Alarm where you can set the timer.
#AlarmclockworksV.01
import os, time
print "The current time is:"
print time.strftime("%H:%M:%S")
alarminfo_1 = raw_input("Enter the Hour:")
alarminfo_2 = raw_input("Enter the Minute:")
alarminfo_3 = raw_input("Enter the Second:")
def alarm_exec():
a_1 = alarminfo_1
a_2 = alarminfo_2
a_3 = alarminfo_3
running = True
running1 = True
running2 = True
running3 = True
running4 = True
while running:
print "The timer was set at:"
print time.strftime("%H:%M:%S")
running = False
while running1:
if len(alarminfo_1) == 1:
a_1 = ("0" + alarminfo_1)
running1 = False
if len(alarminfo_1) == 2:
a_1 = alarminfo_1
running1 = False
while running2:
if len(alarminfo_2) == 1:
a_2 = ("0" + alarminfo_2)
running2 = False
if len(alarminfo_2) == 2:
a_2 = alarminfo_2
running2 = False
while running3:
if len(alarminfo_3) == 1:
a_3 = ("0" + alarminfo_3)
running3 = False
if len(alarminfo_3) == 2:
a_3 = alarminfo_3
running3 = False
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#my problem is i can not get it to open that file, i have tried many different ways to get this to work, but im all out of ideas.
while running4:
if time.strftime("%H:%M:%S") == ("%s:%s:%s" % (a_1, a_2, a_3)):
print "Alarm has gone off."
os.open(r'C:\Documents and Settings\Zack\My Documents\My Music\Unknown Artist\Unknown Album (8-9-2006 3-32-51 PM)\01 Track 01.wma')
time.sleep(30)
running4 = False
alarm_exec()
print 'finished'
raw_input("Press Enter to quit.")