springchill's picture
Create server.py
4778007
raw
history blame contribute delete
445 Bytes
# server.py
from flask import Flask, render_template
import subprocess
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/start-recording', methods=['POST'])
def start_recording():
# Execute the Python script (app.py) with Gradio when the button is pressed
subprocess.Popen(["python", "app.py"])
return "Recording started."
if __name__ == '__main__':
app.run(debug=True)