Closed cslehel closed 3 years ago
Thank you for your report.
I see no inherent problem with running pystray together with flask*, and i think your issue has nothing to do with this library.
After having destroyed the icon, you attempt to join your flask thread. This hangs, since you have not instructed flask to actually terminate. I have no experience with that library, but you will have to to make flask exit as well in action_exit
.
Thank you for your answer. Got it working.
app = Flask( __name__ )
flask_thread_kwargs = { 'host': '127.0.0.1', 'port': 8080, 'threaded': True, 'use_reloader': False, 'debug': False }
@app.route( '/', methods = [ 'GET' ] )
def nothing():
return 'Hello World!'
try:
flask_thread = threading.Thread( target = app.run, daemon = True, kwargs = flask_thread_kwargs ).start()
icon.run()
finally:
print( 'end' )
Flask will stop after
icon.visible = False
icon.stop()
Hi, ca i run pystray with flask ? I made the following application but wont stop when i want to close
After the icon.stop() command i get the finally printed and joining flask thread but not the exit.
Thank you for your time.