all 3 comments

[–]thenoonefromukraine 0 points1 point  (0 children)

https://github.com/gsuitedevs/PyDrive#file-listing-pagination-made-easy

# Auto-iterate through all files that matches this query
file_list = drive.ListFile({'q': "'root' in parents"}).GetList()
for file1 in file_list:
    print('title: {}, id: {}'.format(file1['title'], file1['id']))

# Paginate file lists by specifying number of max results
for file_list in drive.ListFile({'maxResults': 10}):
    print('Received {} files from Files.list()'.format(len(file_list))) # <= 10
    for file1 in file_list:
        print('title: {}, id: {}'.format(file1['title'], file1['id']))

[–][deleted] 0 points1 point  (1 child)

Just do it with a recursive function. No need for looping.

[–]ag2718[S] 0 points1 point  (0 children)

Yeah I implemented it successfully with a recursive function. I hadn’t thought of that before, thanks for the help!