<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/categories/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/categories/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>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>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><item><title>Python 可视化调试</title><link>https://rd163.visword.com/posts/python-visual-debug/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/python-visual-debug/</guid><description>&lt;p>「可视化调试」在 Python 语境下有两层含义:一是用图形界面(GUI)的调试器,在断点处查看变量、调用栈与求值表达式;二是把程序的执行过程可视化,用时间线、火焰图等呈现函数调用顺序与耗时。前者解决「程序为什么是这个状态」,后者解决「程序究竟是怎么跑的」。本文介绍三种常用方案。&lt;/p></description></item><item><title>Python 与 bash 脚本共享配置文件的最佳实践</title><link>https://rd163.visword.com/posts/python-bash-share-conf/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/python-bash-share-conf/</guid><description>&lt;p>同一个工程的代码中常常会同时包含 Python 代码和 bash 脚本，不可避免地会用到配置文件。某些场景下，这两种语言需要共享同一份配置。怎么实现呢？一般有两种方案：&lt;/p></description></item></channel></rss>