我可以使用Python的服务帐户创建Google云端硬盘文件夹吗? [英] Can I create a Google Drive folder using service account with Python?
问题描述
我可以使用帐户所有者创建文件夹,但无法与服务帐户共享。
有没有办法让我的Python脚本使用服务帐户创建文件夹,然后上传一个文件?
您可以创建一个文件夹并上传文件,服务帐户。
但
正如 blog ,你必须记住:
服务帐户是一种与给定项目关联的虚拟用户或机器人帐户。它有一个电子邮件地址和一个加密密钥对。
另外,还有一条来自相关 没有用于服务的用户界面帐户。这些文件仅适用于您的应用程序。 我建议您将真实帐户中的文件夹共享到您的服务帐户,这些文件会更容易。 希望得到这个帮助! I can create a folder using account Owner but cannot share it with service account. Is there a way for My Python script to create a folder using service account and then upload a file? You can create a folder and upload file, same process flow as a real user when you using a service account. As stated in this blog, you have to remember that: A service account is a sort of virtual user or robot account associated with a given project. It has an email address, and a cryptographic key pair. Also, there is a statement from a related SO question that: There is no UI for Service Accounts. The files are only accessible to your app. I suggest that you share a folder from a real account to your service account so that accessing the files would be easier. Hope this help! 这篇关于我可以使用Python的服务帐户创建Google云端硬盘文件夹吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
BUT