Python pydrive仅从列表中获取文件夹
我使用谷歌硬盘库。现在我需要在google drive中获取所有文件夹的名称。Python pydrive仅从列表中获取文件夹,python,google-drive-api,pydrive,Python,Google Drive Api,Pydrive,我使用谷歌硬盘库。现在我需要在google drive中获取所有文件夹的名称。 我发现: self.drive.ListFile().GetList() 但它会返回所有文件。我可以在google drive中仅获取所有文件夹吗 这次修改怎么样?它使用查询检索mimeType为application/vnd.google apps.folder的文件 application/vnd.google apps.folder的mimeType表示文件夹 trashed=false表示从垃圾箱外部检索
我发现:
self.drive.ListFile().GetList()
但它会返回所有文件。我可以在google drive中仅获取所有文件夹吗 这次修改怎么样?它使用查询检索mimeType为
application/vnd.google apps.folder
的文件
的mimeType表示文件夹application/vnd.google apps.folder
表示从垃圾箱外部检索文件trashed=false
- 在这种情况下,
表示文件夹名称title
f = self.drive.ListFile({"q": "mimeType='application/vnd.google-apps.folder' and trashed=false"}).GetList()
for folder in f:
print(folder['title'])