Python Forum

Full Version: PyDrive download file path
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?