Python: 将 google 驱动器中的文件复制到特定文件夹中

Python: Copy a file in google drive into a specific folder

我正在制作一个我需要每周重置的电子表格,我正在尝试使用 PyDrive API 制作文件的副本,它与下面的代码完美配合。

我的问题是我无法指定要在哪个文件夹中保存副本。我想要一个名为 "archive" 的文件夹,其中包含我的所有备份。这可能吗,使用 PyDrive,如果可以,怎么做?谢谢!

## 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()

感谢@Rawing 的评论,我明白了。它是在 "folder" 变量

中指定的