def on_websocket_close(page, sockets): global should_quit eel.sleep(3.0) # We might have just refreshed. Give the websocket a moment to reconnect. if not len(eel._websockets): # At this point we think the browser window has been closed. should_quit = True shut_down()
def kill_bots(): shut_down()