最新发布
python之Python 中的 os.rename() 时间
我正在构建一个重命名一些文件以确定文件是否被锁定的脚本。该脚本递归地对给定目录中的每个文件执行以下操作。 try: os.re...
2年前 (2025-05-04) 9 编程设计
创建字符串的 Pythonic 方式 + vs %
当从许多子字符串中创建一个字符串时,哪个更像 pythonic - + 或 %? big_string = string1 + strin...
2年前 (2025-05-04) 19 编程设计
python之Python 中的回归
尝试通过 pandas 和 statsmodels 进行逻辑回归。不知道为什么我会收到错误或如何修复它。 import pandas as...
2年前 (2025-05-04) 8 编程设计
python之有人可以帮助修复我的代码吗
这是我的代码: with open('lines.txt') as f: for i in f: line = input('...
2年前 (2025-05-04) 9 编程设计
Python 类型错误 : 'int' object is not iterable
下面的代码给我错误 Python 类型错误:“int”对象不可迭代: 代码: hosts = 2 AppendMat...
2年前 (2025-05-04) 8 编程设计
python之使用正则表达式从文件中提取
我有一个文本文档,我想从中提取某些短语。该短语是“MmarC5_”后跟 4 个数字。这是我目前所拥有的: with open("file....
2年前 (2025-05-04) 27 编程设计
python之在 Python 中计算文件的更快方法
我想知道一个文件夹中有多少文件(特别是 Windows 上的共享网络文件夹,如果这在这里有所不同的话)。 我现在正在使用这段代码:...
2年前 (2025-05-04) 9 编程设计
python之我的 Python 3.3.2 有问题吗
使用 Python 3.3.2 shell 时 >>> temperature = 70 >>> i...
2年前 (2025-05-04) 9 编程设计


