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
  [fixed] distinguish file name from the path paul18fr 5 126 Feb-13-2026, 02:49 PM
Last Post: DeaD_EyE
  download a file from a URL JayManPython 8 9,149 Dec-24-2024, 08:47 AM
Last Post: Penelope58
  import a function from another file using relative path paul18fr 6 10,448 Aug-01-2024, 06:40 AM
Last Post: paul18fr
  FTP Download of Last File jland47 4 3,561 Mar-16-2024, 09:15 AM
Last Post: Pedroski55
  File path by adding various variables Mishal0488 2 6,594 Apr-28-2023, 07:17 PM
Last Post: deanhystad
  Script File Failure-Path Error? jerryf 13 13,579 Nov-30-2022, 09:58 AM
Last Post: jerryf
  FTP File Download question / concern cubangt 3 2,715 Jan-06-2022, 07:46 PM
Last Post: cubangt
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 4,149 Sep-09-2021, 01:25 PM
Last Post: Yoriz
  download with internet download manager coral_raha 0 5,048 Jul-18-2021, 03:11 PM
Last Post: coral_raha
  Subprocess.Popen() not working when reading file path from csv file herwin 13 31,100 May-07-2021, 03:26 PM
Last Post: herwin

Forum Jump:

User Panel Messages

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