Created
May 2, 2015 16:28
-
-
Save agusmakmun/345eef1a49e90b25103e to your computer and use it in GitHub Desktop.
Simple Alarm with Looping in Python
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
# File Alarm mp3: http://www.tusfiles.net/fazxijby04ke | |
import os, time | |
minute = 60 | |
hours = minute * minute | |
print 'Alarm dalam 1 Menit..' | |
while True: | |
time.sleep(minute) #ganti sesuai keinginan | |
os.system('mpg321 rest_alert.mp3') | |
''' | |
Ini memakai power dari mpg321 di terminal Linux (Ubuntu). | |
Instalasi sangat simple: | |
$ sudo apt-get install mpg321 | |
$ mpg321 yourmusic.mp3 | |
>>> Syarat: | |
Nama file mp3 tidak menggunakan karakter spasi atau tanda kurung. | |
Karena tidak terbaca oleh mpg321. | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment