瓦蓝天空

导航

 
import pandas as pd
from pathlib import Path

filepath = Path("F:/18017397275/py/pd/")
#偏历目录  包括子目录
for file in filepath.rglob('*.xlsx'):
    print(file)
print('接下来只查询本目录下文件=====================')
##偏历当前目录  不包括子目录
for file in filepath.glob('*.xlsx'):
    print(file)

 

posted on 2022-03-27 12:15  瓦蓝天空  阅读(18)  评论(1)    收藏  举报