The resource loading... loading...

Emergency web socket

Author: lzhqlj, Created: 2023-03-02 15:04:22, Updated:

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. [Spanish] I'm not sure. I'm not going anywhere. 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 from a web server. ws.run_forever ((() Traceback (most recent call last): File , line 1246, ininit_ctx File “<string>”, line 1, in <module> 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?


More

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...