我正在尝试使用通过 anaconda 安装的用于 python 的 dropbox api 从远程(非本地)dropbox 文件夹读取所有文件的路径。此文件夹中有超过 50,000 个文件,包括子文件夹中的一些文件。我正在从子文件夹中获取文件。但是,返回的总结果似乎以 2001 年为上限。如何返回所有 50,000 个文件的路径?
dbx = dropbox.Dropbox(access)
results = dbx.files_list_folder(dbx_path_check, recursive=True)
dbx_files = list(i.path_display for i in results.entries)
print(len(dbx_files))
2001
请您参考如下方法:
我不确定在 Drop box Api 中是否有所不同。你试过这样的事情吗?
import os
dbx_files = []
for root, dirs, filenames in os.walk(your_directory):
dbx_files.append(os.path.join(root,filename))
print(len(dbx_files))
