The code generated by chatgpt to retrieve the data from the CoinAnk thread Imported websocket
url = “wss://fstream.binance.com/ws”
def on_open ((ws): # Send subscription messages, subscribe to BTCUSD perpetual contract 1 minute K-line data Sub_msg = { This is a sub_msg This is the first time I've seen this in my life. I'm not sure what you mean. I'm not sure what you mean. ], I'm not sure. I'm not sure. ws.send ((json.dumps ((sub_msg))))
def on_message ((ws, message): # Process the received K-line data print (message)
if name == “mainWhat is it?
WS = websocket.WebSocketApp ((url, on_open=on_open, on_message=on_message) is a web-based application that can be used to access data.
ws.run_forever (())
Traceback (most recent call last): File bar, line 1246, ininit_ctx File “”, line 1, in ModuleNotFoundError: No module named ‘websocket’
chtgpt says this error is due to the lack of a module called websocket in the Python environment. You need to use a tool like pip or conda to install the module. You can run the following command to install the module in the terminal or command line:
The question is, is that the reason? How about Pip?
lzhqljThank you.
Inventors quantify - small dreamsHello, Pip installation pack can be found at: https://blog.csdn.net/u012693479/article/details/126367014 You can create a websocket link on FMZ using: https://www.fmz.com/api#dial...