os方法读取文件夹中各子文件目录名

path=r'C:\Users\Jone\Desktop\房价预测'
os.chdir(path)
exl=os.listdir(path)
for i in exl:
    print(i)

输出:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_39920026/article/details/108461348