Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
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