我决定去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)
Run Code Online (Sandbox Code Playgroud)
输出/错误消息:
return os.stat(filename).st_mtime
TypeError: argument should be string, bytes or integer, not list
Run Code Online (Sandbox Code Playgroud) python ×1