![](/img/trans.png)
[英]How to list the contents of a Google Drive folder by ID with the V3 API Python client?
[英]**How to list the contents of Multiple folder in Python Google Drive API?
我正在尝试以编程方式列出多个文件夹的内容。 但不知何故无法放入变量
queryt = f'{parent_folder_id} in parents'
while True:
response = service.files().list(q=f'{queryt}',
spaces='drive',
fields='nextPageToken, files(id, name)',
pageToken=page_token).execute()
service.files().list中的第一个变量q似乎不接受变量但接受直接值。
有没有办法解决这个问题?
谢谢
对于任何寻找上述问题的人都可以尝试。
response = gdrive_service.files().list(
q="parents in '"
+ folder_id + "' and trashed =""false",
fields="nextPageToken, ""files(id, name)",
pageSize=400).execute()
谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.