我是python的新手,我一直在尝试遍历一个大目录,其中包含大量具有一定深度的子目录。你知道吗
到现在为止,我得到了这个密码。你知道吗
for dirpath, subdirs, files in os.walk("//media//rayeus//Datos//Mis Documentos//Nueva Carpeta//", topdown=True):
for name in files:
f = os.path.join(dirpath, name)
print f
for name in subdirs:
j = os.path.join(dirpath, name)
print j
其思想是使用迭代在目录内的结构的excel文件上创建清单。你知道吗
问题是,如果我只是离开没有“Nueva carpeta”的同一条路,它就完美地工作了。。。但是当我添加“Nueva Carpeta”时,脚本运行时没有错误,但不返回任何内容
相关问题 更多 >
编程相关推荐