我能够上传文件到谷歌驱动器使用PyDrive库。但是我想看看上传的进度(例如百分比)。我怎样才能做到这一点。以下是我的上传代码:
def uploadToGoogleDrive(myFile):
gauth = GoogleAuth()
gauth.LoadCredentialsFile("umocreds.txt")
if gauth.credentials is None:
gauth.LocalWebserverAuth()
elif gauth.access_token_expired:
gauth.Refresh()
else:
gauth.Authorize()
gauth.SaveCredentialsFile("umocreds.txt")
drive = GoogleDrive(gauth)
driveFile = drive.CreateFile()
driveFile.SetContentFile(myFile)
driveFile.Upload()
目前没有回答
相关问题 更多 >
编程相关推荐