Last active
June 11, 2019 07:21
-
-
Save dewanshrawat15/897b366efbeb4f3e8f80e54527b4e701 to your computer and use it in GitHub Desktop.
A terminal alarm python script. It is dependent on the playsound library. Plays all songs in the directory until you're awake.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from playsound import playsound | |
import os | |
from os import system | |
filename = os.listdir() | |
songs = [] | |
for file in filename: | |
if '.mp3' in file: | |
songs.append(file) | |
t = input("Wake you up at? ") | |
t = int(t) | |
time.sleep(t) | |
for i in songs: | |
# print("Playing => "+i+"") | |
base = '/Volumes/Sherrinford/alarm/' | |
i.replace(" ", "%20") | |
temp_path = base + i | |
playsound(temp_path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment