Absolutely. Since Flask is python you would just move your python script in to the server.py script.
from flask import Flask @app.route('/') def index(): return("<html> <body> <a href=/runScript> Run my Script </a> </body </html>") @app.route('/runScript') def runScript(): #Put all of your regular python code here. #i.e. cut and paste your python script in to this section. return("Ran Script") if __name__ == '__main__': app.run(host='0.0.0.0', port=80)
When you click on the link runScript it would execute your code. When it is done the text "Ran Script" would be returned to the screen. Flask is kind of amazing!