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
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 130 Sep-09-2021, 01:25 PM
Last Post: Yoriz
  download with internet download manager coral_raha 0 341 Jul-18-2021, 03:11 PM
Last Post: coral_raha
  Subprocess.Popen() not working when reading file path from csv file herwin 13 1,673 May-07-2021, 03:26 PM
Last Post: herwin
  Add file to sys.path permanently hcccs 5 1,334 Jan-31-2021, 11:26 AM
Last Post: hcccs
  download file from url fernandosianet 3 760 Oct-29-2020, 03:22 AM
Last Post: bowlofred
  Download file from Private GitHub rep vinuvt 0 905 Jul-27-2020, 11:38 AM
Last Post: vinuvt
  ImportError: No module named pydrive.auth lknights1987 5 1,734 Jun-23-2020, 06:40 PM
Last Post: snippsat
  String to File Path creedX 4 1,167 Apr-06-2020, 07:29 PM
Last Post: creedX
  Add path to a local file in pop-up field pythonscripting 1 735 Feb-08-2020, 10:57 PM
Last Post: Larz60+
  How to get file name without the full path details and without extension aruncom2006 1 3,094 Jan-13-2020, 07:37 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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