【发布时间】:2020-11-13 23:58:08
【问题描述】:
我正在尝试查找 GSheet 中存在的值。连接到谷歌工作表。我可以获取文件中的所有工作表,但我不能出于某种原因迭代工作表列表。 这是文件的样子: 我正在尝试查找单元格值,然后获取该列中的值。
示例代码:
#Gsheet setup w/ key.json token
scope = ['https://www.googleapis.com/auth/drive.file','https://www.googleapis.com/auth/spreadsheets','https://www.googleapis.com/auth/drive']
credentials = ServiceAccountCredentials.from_json_keyfile_name('gdoc.json',scope)
gc = gspread.authorize(credentials
sheet = gc.open("GSHEET_Search_test")
cell = sheet.find("B02")
print(cell)
得到错误:
【问题讨论】:
-
我可以问你关于你的问题吗? 1. 我无法理解
I can't some reason iterable the list of worksheets.。可以问一下它的详细情况吗? 2. 可以提供Getting errors:的详细信息吗? 3. 我可以问你目标的细节吗?通过这些信息,我想尝试了解您的问题。 -
很抱歉没有提供详细信息,但我能够迭代工作表索引值,而不是输出工作表列表。谢谢
-
感谢您的回复。很高兴您的问题得到解决。
标签: python google-sheets gspread pygsheets