Python技术栈 —— 优秀开源库

发布于:2025-02-12 ⋅ 阅读:(39) ⋅ 点赞:(0)

一、Celery

1.1 基本概念

1.2 基本用法

参考文章或视频链接
[1] parallel programming with python
[2] Celery - Distributed Task Queue

二、WebSocket

1.1 websockets库

我要写一个websocket的服务,需要用到哪些模块?

参考文章或视频链接
[1] Python Websockets - Getting started

1.2 FastAPI库

其实FastAPI中的websocket,是来自于starlette库,

参考文章或视频链接
[1] WebSockets - FastAPI

1.3 HTTP与WebSocket协议的区别?

HTTP与WebSocket协议的区别,为什么websocket可以保持长连接,这是否证明了一点,即websocket协议用比http更多的开销,维持了比http更持久的特点

参考文章或视频链接
[1] WebSocket 与 Socket、TCP、HTTP 的关系及区别 - Apifox
[2] WebSockets vs HTTP: Which to choose for your project in 2024
[3] WebSocket vs. HTTP communication protocols
[4] What is web socket and how it is different from the HTTP?
[5] Python web sockets 5 different ways

三、asyncio库

首先,异步不是多线程,asyncio不能使程序做到并发,这一点必须明确,另外,这个库中,有个非常难以搞懂的概念,是事件循环,多的不说,直接看文章比翻译来的直接,信息损失更少。

参考文章或视频链接
[1] 重点阅读 Python Asyncio Part 1 – Basic Concepts and Patterns
[2] 重点阅读 Python Asyncio Part 2 – Awaitables, Tasks, and Futures
[3] Async IO in Python: A Complete Walkthrough

四、Scikit-learn库

参考文章或视频链接
[1] Scikit-learn