我希望能夠上傳文件在我的硬盤到谷歌驅動器使用計劃如下:無法將文件上傳到谷歌驅動器
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
gauth = GoogleAuth()
drive = GoogleDrive(gauth)
this_file = 'apple.txt'
this_file.Upload()
但是,我得到了以下錯誤:
AttributeError: 'str' object has no attribute 'Upload'
我該如何上傳?
this_file是一個字符串。不知道你如何使用這個api,但是你在複製什麼樣的例子? – weston 2014-08-28 23:38:11
http://pythonhosted.org/PyDrive/quickstart.html#creating-and-updating-file – Taylor 2014-08-29 03:55:29