我正在为将来的一些程序制作一个小数据库,我正在测试gsheets,我想制作一个简单的计数器,除了一个单元格给我的输出,一切都很顺利
它输出"Cell R1C1 '2'"
,我不知道如何将其转换为实际使用的变量
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
credentials = ServiceAccountCredentials.from_json_keyfile_name('My Project-b417d3513158.json', scope)
client = gspread.authorize(credentials)
sheet = client.open('Database').sheet1
result = sheet.cell(1,1)
print(result)
您使用的不是gsheets,而是gspread
非常接近,只需在
sheet.cell
上使用value
属性,请参见here相关问题 更多 >
编程相关推荐