我正在尝试使用googledrive/Sheets API从googledrive读取工作表。我想知道如何在不同的标签间导航。在
(忽略其他内容,这是一张随机图片,展示了标签是什么。)
基本上,我想做的是能够访问其他选项卡并阅读其中的文本。每个选项卡的格式相同。我已经能够从第一个标签开始阅读,并希望对其他人也一样。在
这是我的代码:
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import pprint
# Use credentials to interact with the Google Drive API
scope = ['https://spreadsheets.google.com/feeds',
'https://www.googleapis.com/auth/drive']
credentials = ServiceAccountCredentials.from_json_keyfile_name(
'foo', scope)
client = gspread.authorize(credentials)
# Opening the first sheet
sheet = client.open("Resume Data").sheet1
# Prints the code in a nicer format
pp = pprint.PrettyPrinter()
# Extract and print all of the values
list_of_resumes = sheet.get_all_records()
# Printing
pp.pprint(list_of_resumes)
如果我的理解是正确的,那这次修改怎么样?在
发件人:
收件人:
^{pr2}$注:
sheet = spreadsheet.get_worksheet(1)
。这意味着要选择第二个索引的表。在参考:
相关问题 更多 >
编程相关推荐