📜  all_files - 任何代码示例

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

代码示例1
from pathlib import Path

dest = r'C:\Test'
for path in Path(dest).rglob('*.txt'):
    if path.is_file():
        print(path)      
        
import os
 
dest = r'C:\Test'
for root,dirs,files in os.walk(dest):
    for file in files:
        print(os.path.join(root, file))