تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3953 أدوات العرض

I want to upload my file that exit in module directory to google drive .I already created the client api in google developer and I download this client_sercrets.json file and I used pydrive and get error

Invalid client secrets file ('Error opening file', 'client_secrets.json', 'No such file or directory', 2)

I added json file in module .How can I do that. My code is here.


def upload_file(self):
  g_login = GoogleAuth()
  g_login.LocalWebserverAuth()
 drive = GoogleDrive(g_login)
  os.chdir("/docs")
  for file in glob.glob("*.pdf"):
  with open(file,"r") as f:
  fn = os.path.basename(f.name)
  file_drive = drive.CreateFile({'title': fn })
  file_drive.SetContentString(f.read())
  file_drive.Upload()
  logging.info( "The file: " + fn + " has been uploaded")

  logging.info("All files have been uploaded")


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
سبتمبر 22
1554
2
مايو 17
7154
2
أغسطس 25
2300
1
يوليو 25
826
1
يونيو 25
482