from pathlib import Path pths = [pth for pth in Path.cwd().iterdir()]如果是os.listdir()这会返回一个list,文件非常多的时候可能比较耗内存
Powered by: 博客园 Copyright © 2024 网名还没想好 Powered by .NET 8.0 on Kubernetes