How to run a task after flask server starts?
Hey guys, I'm trying to run my flask site in a pyqt5 GUI interface however after app.run(), all functions afterward are ignored until I close the server. This results in me getting a 404 from the PyQT interface. Anyone know how to run the flask server and allow a function to run after it? If it is possible, it would actually be better if I could run them at the same time. Thanks guys
**EDIT**: solved this actually
did the following
def pyqt_function():
#thing to be done by pyqt
t = threading.Thread(target=pyqt_function)
t.daemon = True
t.start()
app.run()
/r/flask
https://redd.it/8gs9zq
Hey guys, I'm trying to run my flask site in a pyqt5 GUI interface however after app.run(), all functions afterward are ignored until I close the server. This results in me getting a 404 from the PyQT interface. Anyone know how to run the flask server and allow a function to run after it? If it is possible, it would actually be better if I could run them at the same time. Thanks guys
**EDIT**: solved this actually
did the following
def pyqt_function():
#thing to be done by pyqt
t = threading.Thread(target=pyqt_function)
t.daemon = True
t.start()
app.run()
/r/flask
https://redd.it/8gs9zq
reddit
r/flask - How to run a task after flask server starts?
0 votes and 0 so far on reddit