gpt4 book ai didi

python - 如何使用 drive-sdk 共享文件?

转载 作者:太空宇宙 更新时间:2023-11-04 03:43:52 25 4
gpt4 key购买 nike

我想知道如何使用 drive-sdk 和 python 与用户共享文件。我一直在使用下面的代码,但它不会与指定用户共享文件,也不会产生错误:

...

Permission = {
'value': 'user@example.com',
'type' : 'user',
'role' : 'reader'
}

drive.permissions().insert(fileId=file['id'], body = Permission,sendNotificationEmails = True )

最佳答案

原因是你执行失败。应该是

drive.permissions().insert(fileId=file['id'], body=Permission, sendNotificationEmails=True ).execute()

关于python - 如何使用 drive-sdk 共享文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24803088/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com