我正在使用 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')))
如何为文件夹复制相同的过程。不是档案。