【发布时间】:2019-07-10 04:53:28
【问题描述】:
我决定为此使用 python,因为我正在学习 Python,所以我尽可能在 Powershell 上使用它。
我对此有理论,但似乎os.stat 不能接受列表,而只能接受字符串或int。现在我只是在去删除之前打印。
import os
import time
path = "\\\\path\\to\\videoroot\\"
now = time.time()
old = now - 1296000
for root, dirs, files in os.walk(path, topdown=False):
if time.ctime(os.path.getmtime(dirs) < old:
print (dirs)
输出/错误信息:
return os.stat(filename).st_mtime
TypeError: argument should be string, bytes or integer, not list
【问题讨论】:
-
不问为什么,我问如何,但感谢您的建设性意见。
-
很抱歉有像尼克这样的讨厌的人。我发现问题在于某些人的教育水平低下。所以是的,是一个列表。我也在处理类似的问题。
标签: python