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
  download a file from a URL JayManPython 8 4,232 Dec-24-2024, 08:47 AM
Last Post: Penelope58
  import a function from another file using relative path paul18fr 6 2,878 Aug-01-2024, 06:40 AM
Last Post: paul18fr
  FTP Download of Last File jland47 4 1,893 Mar-16-2024, 09:15 AM
Last Post: Pedroski55
  File path by adding various variables Mishal0488 2 3,821 Apr-28-2023, 07:17 PM
Last Post: deanhystad
  Script File Failure-Path Error? jerryf 13 7,508 Nov-30-2022, 09:58 AM
Last Post: jerryf
  FTP File Download question / concern cubangt 3 2,029 Jan-06-2022, 07:46 PM
Last Post: cubangt
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 3,153 Sep-09-2021, 01:25 PM
Last Post: Yoriz
  download with internet download manager coral_raha 0 4,037 Jul-18-2021, 03:11 PM
Last Post: coral_raha
  Subprocess.Popen() not working when reading file path from csv file herwin 13 24,002 May-07-2021, 03:26 PM
Last Post: herwin
  Add file to sys.path permanently hcccs 5 14,155 Jan-31-2021, 11:26 AM
Last Post: hcccs

Forum Jump:

User Panel Messages

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