📜  如何从 os 模块查看目录 - Python 代码示例

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

代码示例4
import pathlib

# define the path
currentDirectory = pathlib.Path('.')

for currentFile in currentDirectory.iterdir():
    print(currentFile)