-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflaskServer.py
More file actions
30 lines (24 loc) · 954 Bytes
/
Copy pathflaskServer.py
File metadata and controls
30 lines (24 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#Raspberry pi bell
import os
from flask import Flask, render_template
from flask.ext.triangle import Triangle
app = Flask(__name__, static_path='/static')
Triangle(app)
@app.route('/')
def hello_world():
return render_template('index.html')
@app.route('/bell')
def play_bell():
for x in range(5):
#os.system('omxplayer -o local music/Old-fashioned-doorbell.mp3')
#os.system('omxplayer -o local music/door-bell.mp3')
os.system('omxplayer -o local music/ding-dong.mp3')
os.system('omxplayer -o local music/match5.wav')
os.system('omxplayer -o local music/match0.wav')
#os.system('omxplayer -o local music/match1.wav')
#os.system('omxplayer -o local music/match2.wav')
#os.system('omxplayer -o local music/match3.wav')
#os.system('omxplayer -o local music/match4.wav')
return 'Done'
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5555, debug='True', use_reloader=True)