Open some-crab opened 1 year ago
stop_program =[False]
while not stop_program[0]:
try:
time.sleep(1)
except KeyboardInterrupt:
# socket.stop_socket(thread_name)
socket.stop()
stop_program[0] = True
This code may help you
Sent from Proton Mail for iOS
El sáb, 8 oct, 2022 a las 05:31, some-crab @.***(mailto:El sáb, 8 oct, 2022 a las 05:31, some-crab < ha escrito:
Hi, I am using the ThreadedWebsocketManager example and I notice I can only use break key to stop it running. I guess this might not be a python-binance issue, but wondering how I can keyboard-interrupt the program. I tried:
if name == "main": try: main() except KeyboardInterrupt: print('Got a keyboard interrupt') try: sys.exit(0) except SystemExit: os._exit(0)
and I also tried putting that into the handle_socket_message function, replacing main() with the message printing, but nothing. Is there a reasonable way to do this?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>
Hi, I am using the ThreadedWebsocketManager example and I notice I can only use break key to stop it running. I guess this might not be a python-binance issue, but wondering how I can keyboard-interrupt the program. I tried:
and I also tried putting that into the
handle_socket_message
function, replacingmain()
with the message printing, but nothing. Is there a reasonable way to do this?