import RPi.GPIO as GPIO
from flask import Flask
from flask import request

import os

HOST = "165.194.27.172"

app = Flask(__name__)

@app.route('/', methods = ['POST'])
def openDoor():
	id = request.form['id']
	print id
	if id == 'ZeroPage':
		os.system("aplay /home/pi/sound/and_open.wav &")	
		execfile("open.py")
		return 'Ok'
	else:
		return 'access denied'

if __name__ == '__main__':
	app.run(HOST,5000)

@@ -67,16 +67,29 @@
 request%0A
+import random
 %0Aimport 
@@ -307,18 +307,54 @@
 %09%0A%09%09
-execfile(%22
+os.system(%22nohup sudo python /home/pi/zerobot/
 open
@@ -359,16 +359,19 @@
 en.py%22)%0A
+%09%09%0A
 %09%09return
@@ -383,16 +383,173 @@
 %0A%09else:%0A
+%09%09a = random.random()%251%0A%09%09%0A%09%09if a == 0:%0A%09%09%09os.system(%22aplay /home/pi/sound/no_doing1.wav &%22)%0A%09%09else:%0A%09%09%09os.system(%22aplay /home/pi/sound/no_doing2.wav &%22)%0A%09%09%0A
 %09%09return

add error sound