# Assign the callbacks. kws.on_ticks = on_ticks kws.on_connect = on_connect
#kws.on_tick = _parse_binary # Infinite loop on the main thread. Nothing after this will run. # You have to use the pre-defined callbacks to manage subscriptions. kws.connect(threaded=True)
count = 0 while True: count += 1 #print("This is main thread. Will change webosocket mode every 5 seconds.") if False: if kws.is_connected(): #print("Set mode to LTP") r=kws.set_mode(kws.MODE_LTP, [209029])