Skip to content

Instantly share code, notes, and snippets.

@AntoineDao
Created February 6, 2018 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AntoineDao/6d88160e4d2d497a8a4345a2b6d8d0ed to your computer and use it in GitHub Desktop.
Save AntoineDao/6d88160e4d2d497a8a4345a2b6d8d0ed to your computer and use it in GitHub Desktop.
from flask import Flask
app = Flask(__name__)
import subprocess
process = 0
@app.route('/')
def hello_world():
return 'Hello, World!'
@app.route('/process')
def launch_process():
p = subprocess.Popen("sudo moonlight stream", shell=True)
return str(p.pid)
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment