Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PyDrive download file path
#1
I had a bit of a problem with an app I'm making. I have managed to get the module 'Pydrive' to download a file from my google drive using drive API, however, it keeps saving the file in the same folder as the python file, not in the download folder.

Here is the code:
def download():
     selection = Files.curselection()[0]
     fileidselection = file_ids[selection]
     lengthid = len(fileidselection)
     actualid = fileidselection[4:lengthid]
     file6 = drive.CreateFile({'id': actualid})
     x = '%s' % (file6['title'])
     print(x)
     a = shorten_path(x, 1)
     print(a)
     file6.GetContentFile(str(a))
Anyone know anyway I can make the downloaded file end up in a different directory?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  FTP Download of Last File jland47 4 393 Mar-16-2024, 09:15 AM
Last Post: Pedroski55
  download a file from a URL JayManPython 7 1,352 Jun-28-2023, 07:52 AM
Last Post: JayManPython
  File path by adding various variables Mishal0488 2 1,032 Apr-28-2023, 07:17 PM
Last Post: deanhystad
  Script File Failure-Path Error? jerryf 13 3,462 Nov-30-2022, 09:58 AM
Last Post: jerryf
  FTP File Download question / concern cubangt 3 1,309 Jan-06-2022, 07:46 PM
Last Post: cubangt
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 2,210 Sep-09-2021, 01:25 PM
Last Post: Yoriz
  download with internet download manager coral_raha 0 2,951 Jul-18-2021, 03:11 PM
Last Post: coral_raha
  Subprocess.Popen() not working when reading file path from csv file herwin 13 15,071 May-07-2021, 03:26 PM
Last Post: herwin
  Add file to sys.path permanently hcccs 5 8,392 Jan-31-2021, 11:26 AM
Last Post: hcccs
  download file from url fernandosianet 3 2,313 Oct-29-2020, 03:22 AM
Last Post: bowlofred

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020