我正在制作一个需要每周重置的电子表格,我正在尝试使用 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 的评论,我明白了。它是在“文件夹”变量中指定的
关于Python:将谷歌驱动器中的文件复制到特定文件夹中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43865016/