【发布时间】:2017-01-12 14:44:31
【问题描述】:
我需要使用 python 获取文件夹的最新文件。使用代码时:
max(files, key = os.path.getctime)
我收到以下错误:
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'a'
【问题讨论】:
-
您要查找哪个文件?将您的相关代码添加到问题中。
-
我猜为什么它可能对您不起作用:“文件”是文件名元素列表还是单个文件名字符串?
标签: python python-3.x python-2.7