0

The user enters the full location of a file and the program determines whether the file is a sound file or an application and opens it after a user specified time.

Example:
Location: C:\Where ever\file.mp3
OR
C:\Another Where Ever\prog.exe
TIme(in mins): 10

import time
import subprocess

loc=raw_input("Enter the full location: ")
t=(input("Time(in minutes): "))*60
print t

def prog():
    l=len(loc)
    ext=loc[l-3:l]
    if(ext=="exe"):
        time.sleep(t)
        subprocess.call(loc)
    elif(ext=="mp3"):
        time.sleep(t)
        subprocess.call(["C:\Program Files\Windows Media PLayer\mplayer2.exe",loc])

prog()
1
Contributor
2
Replies
3
Views
8 Years
Discussion Span
Last Post by sravan953
0

NOTE: In line 16, replace the location of the media player I have entered with the location where the media player is installed in your computer.

0

HINT: You can also use this as an alarm! Just enter the location of a sound file and the time after which you want the alarm.

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.