# PythonStudy **Repository Path**: south-it-school-project/pythonstudy ## Basic Information - **Project Name**: PythonStudy - **Description**: No description available - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-09 - **Last Updated**: 2025-12-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # PythonStudy 安装python(3.13.11版本,兼容后续生态环境) ## pip命令 pip 是 Python 包管理工具,该工具提供了对 Python 包的查找、下载、安装、卸载的功能。 以下是常用的pip使用命令: 显示版本和路径 : pip -V 或者 pip --version 获取帮助 : pip -h or pip --help 升级pip : pip install --upgrade pip(或者:pip install -U pip) 安装包 : pip install some_package (安装时指定版本号:pip install some_package==version_number) 升级包 : pip install --upgrade some_package 卸载包 : pip uninstall some_package 搜索包 : pip search some_package 显示安装包信息 : pip show some_package 查看指定包的详细信息 : pip show -f some_package 列出已安装的包 : pip list 查看可升级的包 : pip list -o 创建依赖文件:pip freeze > requirements.txt 使用依赖文件安装:pip install -r requirements.txt ## web框架 1.flash 结合 sqlalchemy 2.Django(web+orm) 3.fastapi + sqlmodel(封装了sqlmodel) ### web项目如何部署运行 1. WSGI WSGI (Web Server Gateway Interface)是 Python 的 Web 服务器和 Web 应用程序之间的标准接口规范。它定义了服务器和应用程序如何通信,使得任何符合 WSGI 规范的 Web 框架都可以在任何符合 WSGI 规范的 Web 服务器上运行。 应用程序(Application):处理请求,返回响应 服务器(Server):接收 HTTP 请求,调用应用程序,返回 HTTP 响应 中间件(Middleware):连接服务器和应用程序的组件,可以处理请求和响应 2. ASGI ASGI 是 Asynchronous Server Gateway Interface(异步服务器网关接口) 的缩写,是 Python Web 服务器和 Web 应用之间的一种标准接口。 WSGI 的核心问题 1. 同步阻塞 2. 不支持 WebSocket / 长连接 3. 无法优雅支持异步框架(async/await) 4. 扩展能力差 想支持: HTTP/2 , SSE(服务端推送) , WebSocket , 长轮询 , 都非常别扭,基本靠 hack。