📌  相关文章
📜  python 获取目录中的最新文件 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:14.908000             🧑  作者: Mango

代码示例1
import glob
import os

list_of_files = glob.glob('/path/to/folder/*') # * means all if need specific format then *.csv
latest_file = max(list_of_files, key=os.path.getctime)
print(latest_file)