【发布时间】:2021-09-07 20:25:03
【问题描述】:
我正在关注this 学习如何使用 PyDrive 库
我在....PycharmProjects\Qt\venv\Lib\site-packages 安装了 PyDrive
我复制代码并保存在c:\users\me\test.py
现在我被困在如何运行它上。我已经有 Google Drive 帐户,其中存储了一些文件。
我需要简单的步骤来从命令提示符或 Idle 或 PyCharm 运行它 我需要谷歌云帐户或其他任何东西吗?
我改成了 (venv)c:\user\me\test.py
我明白了
ERROR File "..\PycharmProjects\Qt\venv\lib\site-packages\oauth2client\clientsecrets.py", line 121, in _loadfile
with open(filename, 'r') as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'client_secrets.json'
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
gauth = GoogleAuth()
gauth.LocalWebserverAuth()
drive = GoogleDrive(gauth)
file1 = drive.CreateFile({'title': 'Hello.txt'})
file1.SetContentString('Hello')
file1.Upload()
docsfile.GetContentFile('test.html', mimetype='text/html')
【问题讨论】:
-
你是什么意思“改变驱动器”?你在激活
Qt/venv??不能直接从 PyCharm 运行脚本吗?