You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

ipico's avatar
ipico
Explorer | Level 3
5 years ago

Re: Retrieve with a File limit and File count

I'm looking for a way to get the count of entries from this python api call:

e=dbx.files_list_folder('/myfolder').entries

None of the following work:

>>> print(e.count)
<built-in method count of list object at 0x107dcd098>

>>> print(e.size)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'list' object has no attribute 'size'

>>> print(e.list)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'list' object has no attribute 'list'

I can iterate and increment in a for loop but would prefer to use an existing method:

i=0
for entry in dbx.files_list_folder('/myfolder').entries:
    i=i+1

print(i)

Is there a way to get the count of the files returned without actually iterating through the list? 

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,895 PostsLatest Activity: 3 hours ago
328 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!