【发布时间】:2018-10-22 06:34:48
【问题描述】:
我正在使用 Google Colab 进行机器学习。很多时候,我需要使用 Pydrive 使用 Google Drive 下载解决方案 CSV。如下图
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from google.colab import auth
from oauth2client.client import GoogleCredentials
auth.authenticate_user()
gauth = GoogleAuth()
gauth.credentials = GoogleCredentials.get_application_default()
drive = GoogleDrive(gauth)
uploaded = drive.CreateFile({'title': 'dogsVScats.csv'})
uploaded.SetContentFile('dogsVScats.csv')
uploaded.Upload()
print('Uploaded file with ID {}'.format(uploaded.get('id')))
如何为文件夹复制相同的过程。不是文件。
【问题讨论】:
标签: python python-3.x google-colaboratory pydrive