4

I'm making a spreadsheet that I need to reset every single week, I'm trying to use the PyDrive API to make a copy of the file, which works perfectly with the code below.

My problem is that i cant specify which folder I want to save the copy in. I would like to have a folder called "archive" which contains all my backups. Is this possible, using PyDrive and if so, how? Thanks!

## Create a new Document in Google Drive
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
gauth = GoogleAuth()
gauth.LocalWebserverAuth()
drive = GoogleDrive(gauth)
folder = "########"
title = "Copy of my other file"
file = "############"
drive.auth.service.files().copy(fileId=file,
                           body={"parents": [{"kind": "drive#fileLink",
                                 "id": folder}], 'title': title}).execute()
Søren Eriksen
  • 163
  • 1
  • 3
  • 15

1 Answers1

0

Thanks to the comment from @Rawing I figured it out. It was specified in the "folder" variable

Søren Eriksen
  • 163
  • 1
  • 3
  • 15