有两个流行的库.
websocket-client
- 安装
pip install websocket-client
- 官网
https://github.com/websocket-client/websocket-client
ws4py
- 安装
pip install websocket-client
- github
https://github.com/Lawouach/WebSocket-for-Python - doc
https://ws4py.readthedocs.io/en/latest/sources/clienttutorial/