在 pygsheets 中正确使用 list_ssheets() 和 parent_id
Proper usage of list_ssheets() with a parent_id in pygsheets
我一直在尝试了解如何将 list_ssheets() 与 parent_id 过滤器一起使用。
以下工作正常,returns 是所有工作表的列表(包括我试图从文件夹中分离出来的工作表):
the_list_of_sheets = gc.list_ssheets()
list_ssheets() 本身运行良好并且 return 是所有工作表,但后面 return 是一个空列表(xxxx 是包含的文件夹 ID) :
the_list_of_sheets = gc.list_ssheets('xxxxxxxxxxxxxxxxxxxxxxxxxxx')
我尝试了很多不同的方法来让它工作,但似乎无法找到正确的语法。
将 list_ssheets() 与 parent_id 到 return 特定目录中的所有工作表一起使用的正确方法是什么?
谢谢!
谢谢 tehhowch,我想我解决了。
虽然我的目标文件夹中的工作表已与我的 pgysheets 帐户共享,但 文件夹本身不是 !愚蠢的错误,但很高兴解决了它。
<directory xxxxxxxxxxx> (must be shared!)
<file 1> (shared!)
<file 2> (not shared!)
<file 3> (shared!)
所以现在,
the_list_of_sheets = gc.list_ssheets('xxxxxxxxxxx')
Returns 包含文件 1 和文件 3 的列表。耶!
我一直在尝试了解如何将 list_ssheets() 与 parent_id 过滤器一起使用。
以下工作正常,returns 是所有工作表的列表(包括我试图从文件夹中分离出来的工作表):
the_list_of_sheets = gc.list_ssheets()
list_ssheets() 本身运行良好并且 return 是所有工作表,但后面 return 是一个空列表(xxxx 是包含的文件夹 ID) :
the_list_of_sheets = gc.list_ssheets('xxxxxxxxxxxxxxxxxxxxxxxxxxx')
我尝试了很多不同的方法来让它工作,但似乎无法找到正确的语法。
将 list_ssheets() 与 parent_id 到 return 特定目录中的所有工作表一起使用的正确方法是什么?
谢谢!
谢谢 tehhowch,我想我解决了。
虽然我的目标文件夹中的工作表已与我的 pgysheets 帐户共享,但 文件夹本身不是 !愚蠢的错误,但很高兴解决了它。
<directory xxxxxxxxxxx> (must be shared!)
<file 1> (shared!)
<file 2> (not shared!)
<file 3> (shared!)
所以现在,
the_list_of_sheets = gc.list_ssheets('xxxxxxxxxxx')
Returns 包含文件 1 和文件 3 的列表。耶!