<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Python - 标签 - 研发日志 · R&amp;D Log</title><link>https://rd163.visword.com/tags/python/</link><description>Python - 标签 - 研发日志 · R&amp;D Log</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><managingEditor>whutluohui@gmail.com (小智晖)</managingEditor><webMaster>whutluohui@gmail.com (小智晖)</webMaster><copyright>本作品采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可。</copyright><lastBuildDate>Sat, 20 Sep 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://rd163.visword.com/tags/python/" rel="self" type="application/rss+xml"/><item><title>python3 开发环境搭建</title><link>https://rd163.visword.com/posts/python3-development-env-setup/</link><pubDate>Sat, 20 Sep 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/python3-development-env-setup/</guid><description><![CDATA[<h2 id="版本选择" class="headerLink">
    <a href="#%e7%89%88%e6%9c%ac%e9%80%89%e6%8b%a9" class="header-mark"></a>版本选择</h2><p>建议使用 Python 3.10 及以上版本，因为更低版本已陆续停止维护。以 Python 3.8 为例，它已于 <strong>2024-10-07</strong> 正式结束生命周期（End of Life, EOL）,Python 官方不再提供 bug 修复和安全更新。</p>]]></description></item><item><title>Python asyncio 的事件循环机制</title><link>https://rd163.visword.com/posts/python-asyncio-event-loop/</link><pubDate>Sun, 07 Sep 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/python-asyncio-event-loop/</guid><description>&lt;p>在使用 Python 的 asyncio 库实现异步编程时，协程（coroutine）与事件循环（event loop）这两个概念总是形影不离：协程只声明了「怎么挂起、怎么恢复」,而真正驱动这些协程不断推进的「调度器」,就是事件循环。理解事件循环的角色，是写出正确的异步代码、以及做性能选型（比如要不要换 uvloop）的前提。&lt;/p></description></item><item><title>Python 协程简介</title><link>https://rd163.visword.com/posts/python-corouting-intro/</link><pubDate>Sun, 13 Apr 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/python-corouting-intro/</guid><description><![CDATA[<p>Python 在 3.5 版本中引入了协程相关的语法糖 <code>async</code> 和 <code>await</code>，在 Python 3.7 版本中又提供了 <code>asyncio.run()</code> 来运行一个协程。因此建议大家学习协程时直接使用 Python 3.7 及以上版本。</p>
<p>Python 官方提供了各版本的 asyncio 文档，详见<a href="https://docs.python.org/zh-cn/3.13/library/asyncio-task.html" target="_blank" rel="noopener noreferrer">协程与任务官方文档</a>。</p>]]></description></item><item><title>WebDAV 自建方案选型与实践</title><link>https://rd163.visword.com/posts/webdav-deploy/</link><pubDate>Fri, 28 Feb 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/webdav-deploy/</guid><description><![CDATA[<p>WebDAV(Web Distributed Authoring and Versioning,RFC 4918)是在 HTTP 之上扩展的一组方法(如 <code>PUT</code>、<code>PROPFIND</code>、<code>MKCOL</code>、<code>COPY</code>、<code>MOVE</code>),使得 Web 服务器可以当作可读写的网盘来用。相比 SFTP 或 NFS，它的优势在于走标准 HTTP(S) 端口、穿透代理和防火墙更友好，并且被几乎所有的笔记软件（如 Obsidian 的 Remotely Save 插件）、文件管理器（Windows 资源管理器、macOS Finder、Linux Nautilus/Dolphin）原生支持。</p>]]></description></item><item><title>Python HTTP 客户端库</title><link>https://rd163.visword.com/posts/python-http-client-libs/</link><pubDate>Wed, 15 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/python-http-client-libs/</guid><description><![CDATA[<h2 id="urlliburllib2" class="headerLink">
    <a href="#urlliburllib2" class="header-mark"></a>urllib、urllib2</h2><p>Python 2 时代常用的标准库 HTTP 客户端是 <code>urllib</code> 和 <code>urllib2</code>,它们提供了 URL 编码、请求构造、认证、重定向等基础能力，让我们能在不依赖第三方库的情况下完成大多数 HTTP 调用。两者的分工略有差异:<code>urllib</code> 偏向基础 URL 处理,<code>urllib2</code> 则在请求定制（如自定义 header、handler、opener）上更强大。</p>]]></description></item><item><title>Conda 的替代品</title><link>https://rd163.visword.com/posts/alternatives-for-conda/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/alternatives-for-conda/</guid><description><![CDATA[<h2 id="背景为什么需要替代品" class="headerLink">
    <a href="#%e8%83%8c%e6%99%af%e4%b8%ba%e4%bb%80%e4%b9%88%e9%9c%80%e8%a6%81%e6%9b%bf%e4%bb%a3%e5%93%81" class="header-mark"></a>背景：为什么需要替代品</h2><p>长期以来，Anaconda Distribution 和 Miniconda 是 Python 数据科学与科学计算场景下最常用的发行版。然而自 2020 年起，Anaconda, Inc. 更新了其服务条款（Terms of Service）,对商业用途做出了限制:</p>]]></description></item><item><title>django-cms</title><link>https://rd163.visword.com/posts/django-cms-intro/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/django-cms-intro/</guid><description>&lt;p>由 Django 编写的企业级 CMS(Content Management System，内容管理系统),它功能实用、安全可靠，支持拖拽上传图片、轮播图、Docker 部署等功能，可轻松进行二次开发，多用于构建企业官网，比如：国家地理（National Geographic）、NASA、L&amp;rsquo;Oréal、Canonical、PBS 等机构的网站都基于它开发而成。本文整理其背景、核心概念与本地启动方式，方便快速评估是否适合自己的项目。&lt;/p></description></item><item><title>Python embeddable 版本安装过程记录</title><link>https://rd163.visword.com/posts/python-embeddable-install/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/python-embeddable-install/</guid><description><![CDATA[<ul>
<li>操作系统：Windows 11</li>
<li>Python 版本：Python 3.10</li>
</ul>
<h2 id="step-1安装-python-310" class="headerLink">
    <a href="#step-1%e5%ae%89%e8%a3%85-python-310" class="header-mark"></a>Step 1：安装 Python 3.10</h2><p>从下载列表 <a href="https://www.python.org/downloads/release/python-3100/" target="_blank" rel="noopener noreferrer">Python 3.10.0</a> 可以看出，Installer 版本的安装文件大小比 Embeddable 版本大很多：</p>]]></description></item><item><title>Python Web 框架</title><link>https://rd163.visword.com/posts/python-web-framework/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/python-web-framework/</guid><description><![CDATA[<p>Python 生态里有不少成熟的 Web 框架，各自针对不同的场景做了取舍。本文按&quot;大而全 / 微框架 / 高性能异步&quot;三类，记录我在调研与使用过程中沉淀的几款主流框架要点，以及若干实操链接。</p>]]></description></item><item><title>Python 的 dataclass</title><link>https://rd163.visword.com/posts/python-dataclass/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/python-dataclass/</guid><description><![CDATA[<p><code>dataclasses</code> 是 Python 3.7 起进入标准库的一个模块，由 <a href="https://peps.python.org/pep-0557/" target="_blank" rel="noopener noreferrer">PEP 557</a> 引入，作者是 Eric V. Smith。它的核心目标是：为「主要用来存储数据的类」自动生成 <code>__init__</code>、<code>__repr__</code>、<code>__eq__</code> 等样板方法（boilerplate）,让开发者把精力放在字段定义上而不是重复的 <code>def __init__(self, ...)</code>。</p>]]></description></item></channel></rss>