<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Discuz! BBS - Python应用</title>
    <link>https://www.unicoder.cn/forum.php?mod=forumdisplay&amp;fid=46</link>
    <description>Latest 20 threads of Python应用</description>
    <copyright>Copyright(C) Discuz! BBS</copyright>
    <generator>Discuz! Board by Comsenz Inc.</generator>
    <lastBuildDate>Sat, 16 May 2026 06:42:22 +0000</lastBuildDate>
    <ttl>60</ttl>
    <image>
      <url>https://www.unicoder.cn/static/image/common/logo_88_31.gif</url>
      <title>Discuz! BBS</title>
      <link>https://www.unicoder.cn/</link>
    </image>
    <item>
      <title>python返回json字符串</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=573</link>
      <description><![CDATA[return HttpResponse(json.dumps(D,ensure_ascii=False),content_type=\&quot;application/json,charset=utf-8\&quot;)
]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Mon, 23 Mar 2026 13:18:44 +0000</pubDate>
    </item>
    <item>
      <title>python-docx 设置华文楷体 小四 加粗</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=356</link>
      <description><![CDATA[python-docx 设置字体





自定义字体：如果你的Word模板中没有“华文楷体”，可能需要将该字体添加到Word中或者确保你的系统中已安装该字体。在Word中直接添加字体的方法通常是通过“字体设置”对话框。但在某些情况下，如使用python-docx直接生成文档时，你可能需要 ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Sun, 27 Apr 2025 02:06:45 +0000</pubDate>
    </item>
    <item>
      <title>Python运行Powershell命令</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=355</link>
      <description><![CDATA[如何使用Python运行PowerShell命令
在Python中，您可以使用subprocess模块来运行外部命令，包括PowerShell命令。以下是如何在Python中运行mkdir d:\\ll\\lll这个PowerShell命令的步骤：

导入subprocess模块：这是Python标准库中的一个模块，用于生成新的进程、连接到它们 ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Sat, 26 Apr 2025 15:54:19 +0000</pubDate>
    </item>
    <item>
      <title>使用Python正则表达式提取特定内容</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=354</link>
      <description><![CDATA[使用Python正则表达式提取特定内容
为了使用Python正则表达式提取字符串中第一对***中的内容，我们需要按照以下步骤进行操作：

编写正则表达式：我们需要一个正则表达式来匹配第一对***中的内容。

使用re模块：Python的re模块提供了强大的正则表达式功能。

提取匹配 ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Sat, 26 Apr 2025 12:35:05 +0000</pubDate>
    </item>
    <item>
      <title>Python for 循环中的 range 函数与步长（step）</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=352</link>
      <description><![CDATA[Python for 循环中的 range 函数与步长（step）
在Python中，for 循环是一种常用的迭代结构，而 range 函数则是生成一个数字序列的便捷方法。在 range 函数中，可以指定起始值、结束值和步长。下面是对 range 函数及其步长参数的详细解释。

基本语法

Python
采纳
复制 ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Fri, 25 Apr 2025 11:57:04 +0000</pubDate>
    </item>
    <item>
      <title>Python logging 详解</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=351</link>
      <description><![CDATA[logging 库使用说明
1. logging 库简介
logging 是 Python 标准库中的一个模块，用于记录日志信息。它提供了一套灵活的日志记录系统，可以帮助开发者记录程序运行时的各种信息，如调试信息、错误信息等。

2. 基本使用步骤
2.1 导入 logging 模块
首先，需要在代码顶部 ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Wed, 23 Apr 2025 16:43:30 +0000</pubDate>
    </item>
    <item>
      <title>如何将yield返回</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=350</link>
      <description><![CDATA[检查生成器的返回值和状态管理
确保在生成器结束时正确处理返回值和状态：

def generator_with_return():
    try:
        yield \&quot;Before return\&quot;
        return \&quot;Generator returned\&quot;  # 注意这里的return语句将结束生成器
    finally:
        yield \&quot;Generator c ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Wed, 23 Apr 2025 14:28:24 +0000</pubDate>
    </item>
    <item>
      <title>Python 的目录操作和特殊目录导入</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=340</link>
      <description><![CDATA[源代码：


获取父目录的父目录的绝对路径：

__file__ 是一个特殊变量，它包含了当前脚本的路径。
os.path.abspath(__file__) 将这个路径转换为绝对路径。
os.path.dirname(path) 返回指定路径的目录名。连续调用两次 os.path.dirname，意味着我们获取了当前脚本所在目 ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Sun, 30 Mar 2025 20:44:33 +0000</pubDate>
    </item>
    <item>
      <title>使用Python通过Socket传输大文件</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=335</link>
      <description><![CDATA[使用Socket传输大文件（如5GB的mp4文件）时，需要考虑数据的分段传输、接收确认以及异常处理等因素。以下是一个简单的例子，展示了如何使用Python的Socket库来传输大文件。
服务端代码：


客户端代码：


使用说明
服务器端：运行服务器端代码，它会在指定的端口（如65 ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Sat, 08 Mar 2025 09:29:49 +0000</pubDate>
    </item>
    <item>
      <title>Python与 Delphi共享数据</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=333</link>
      <description><![CDATA[使用内存映射文件（适用于Windows）
这种方法通过Windows API来实现，允许两个应用程序共享内存中的数据块。这种方法在性能上非常高效，但需要Windows平台支持，并且需要处理同步问题以避免竞争条件。在Delphi中可以使用TMemoryMappedFile类来实现。在Python中，可以使 ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Sun, 02 Mar 2025 03:16:40 +0000</pubDate>
    </item>
    <item>
      <title>Python 多进程编程，每个客户端发起多个socket连接</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=332</link>
      <description><![CDATA[导入必要的模块
定义一个函数用于创建socket客户端:

创建并启动多个进程:
确保服务器的IP地址和端口号正确无误，并且服务器已经准备好接受连接。

在多进程环境中使用全局解释器锁（GIL）可能会限制并发性能在某些情况下，尤其是在CPU密集型任务中。但对于I/O密集型任 ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Fri, 28 Feb 2025 22:07:21 +0000</pubDate>
    </item>
    <item>
      <title>Python 打印错误行号</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=331</link>
      <description><![CDATA[Python可以打印跟踪出来的错误行号。
如果你想打印Traceback（错误堆栈跟踪），你可以使用traceback模块。traceback模块提供了多种方式来捕获、格式化和打印错误堆栈。如果你想打印出Traceback的行数（即错误发生在哪一行），你可以使用traceback.extract_tb()函数。

 ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Fri, 28 Feb 2025 20:05:04 +0000</pubDate>
    </item>
    <item>
      <title>Python 自动回收会回收对象拥有的对象吗</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=330</link>
      <description><![CDATA[‌Python的自动回收机制会回收对象拥有的对象‌。Python的垃圾回收机制主要通过引用计数和标记-清除算法来管理内存。当一个对象的引用计数变为0时，该对象及其拥有的对象都会被回收。此外，Python还通过循环引用检测器来处理循环引用的情况，确保即使对象之间相互引用也 ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Sat, 22 Feb 2025 20:20:46 +0000</pubDate>
    </item>
    <item>
      <title>Python 在新窗口调其他应用程序</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=328</link>
      <description><![CDATA[如下：
关闭进程：]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Fri, 14 Feb 2025 13:54:20 +0000</pubDate>
    </item>
    <item>
      <title>Python subprocess</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=327</link>
      <description><![CDATA[Python subprocess


在 Windows 系统上，你可以使用 subprocess 模块来启动一个新的 PowerShell 进程，并在该 PowerShell 进程中运行一个 .py 程序。你可以通过指定 shell=True 和使用 creationflags=subprocess.CREATE_NEW_CONSOLE 来确保 PowerShell 在一个新的控制 ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Thu, 13 Feb 2025 13:51:53 +0000</pubDate>
    </item>
    <item>
      <title>Python 深层删除对象</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=326</link>
      <description><![CDATA[python删除一个对象,进行深层删除吗?
在Python中，当你提到“删除对象”时，通常指的是从内存中移除对象引用，以便Python的垃圾回收机制可以回收这块内存。但是，如果你想要确保一个对象及其所有相关联的子对象都被彻底删除，这个过程通常被称为“深层删除”。在Python ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Wed, 12 Feb 2025 11:20:43 +0000</pubDate>
    </item>
    <item>
      <title>PYthon获取计算机硬件情况</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=291</link>
      <description><![CDATA[获取Linux的硬件实时数据，采用：]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Wed, 04 Dec 2024 15:52:01 +0000</pubDate>
    </item>
    <item>
      <title>Python 调用动态链接库 DLL</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=282</link>
      <description><![CDATA[Python 调用动态库，需要以下步骤：


请确保DLL文件与你的Python脚本位于同一目录中，或者提供DLL文件的完整路径。此外，DLL中的函数名称和参数类型应该与实际的DLL导出匹配，否则可能会导致错误。



如果报Python/ module ‘clr‘ has no attribute ‘AddReference‘ ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Sun, 01 Dec 2024 12:04:26 +0000</pubDate>
    </item>
    <item>
      <title>Python 引用传递和值传递</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=254</link>
      <description><![CDATA[探讨 Python 值传递和引用传递
了解完上面的一些基本概念后，我们从可变（mutable）和不可变（immutable）两种类型来探讨 Python 值传递和引用传递：
1、不可变（immutable）类型
不可变变量的值一旦创建，就不能被修改。如果你尝试修改一个不可变对象的值，Python 将会 ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Tue, 24 Sep 2024 18:43:52 +0000</pubDate>
    </item>
    <item>
      <title>Pool 进程间共享数据</title>
      <link>https://www.unicoder.cn/forum.php?mod=viewthread&amp;tid=253</link>
      <description><![CDATA[使用如下方法：


Manager() 注意。
这里有多种写法：



使用多进程，与多进程共享对象等的优缺点：
1、多进程共享对象（包括级联对象），作为函数参数传的是值而非引用，一定要注意，如果传入工作函数，则很可能出现值分叉的情况，建议看第3）条。
2、多进程，如果在 ...]]></description>
      <category>Python应用</category>
      <author>admin</author>
      <pubDate>Fri, 20 Sep 2024 18:39:21 +0000</pubDate>
    </item>
  </channel>
</rss>