We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

abhannan's avatar
abhannan
Helpful | Level 5
7 years ago

Dropbox equivalent of os.walk() for python

Hi, I'm looking to list all the files in folders and sub-folders of one dropbox account with Python v2 API. Is there any equivalent of os.walk() in the API? I can see that we have files_list_folder...
  • Greg-DB's avatar
    7 years ago

    If you need to list all entries, included nested files and folders, you should use files_list_folder and files_list_folder_continue. You can do so by setting recursive=True on the initial call to files_list_folder.

     

    The Dropbox API doesn't offer a way to automatically retrieve the file extension, so you should extract that from the name or path.