Python Forum
PyDrive download file path - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: PyDrive download file path (/thread-26326.html)



PyDrive download file path - MiniMinnow - Apr-28-2020

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?