I am using pyDrive to get a list of all files in specific folder id's. If I hard code the folder id, it works fine, but I'd like to use a loop, and cycle through a list of folder ID's. It might just be that I'm not formatting the variable into the command correctly.
This works fine....
file_list = drive.ListFile({'q': "'0B1fhQb9wymxEUUFGVXpfYlJhTk0' in parents and trashed=false"}).GetList()
But if I put that statement into a for loop to cycle through a list of folder ID's, it does not work. The '0B1fhQb9wymxEUUFGVXpfYlJhTk0' is the part I need to swap out for the variable in the for loop.
I've tried every kind of for loop I can find an example of on the net, and every kind of way to substitute the loop variable. Even tried putting the first half of the command in a string, the last half in another, and then "first + x + last", but that didn't work either.
for x in listofpersonfolders:
file_list = drive.ListFile({'q': "\'x\' in parents and trashed=false"}).GetList()
print file_list
and also tried
for x in listofpersonfolders:
file_list = drive.ListFile({'q': "'x' in parents and trashed=false"}).GetList()
print file_list