简体   繁体   English

gspread电子表格未加载,没有错误

[英]gspread spreadsheet not loading, no errors

I am writing a python script using gspread. 我正在使用gspread编写python脚本。 Here is the code: 这是代码:

json_key = json.load(open('<path to json>'))
scope = ['https://spreadsheets.google.com/feeds']
credentials = SignedJwtAssertionCredentials(json_key['client_email'], json_key['private_key'], scope)
gc = gspread.authorize(credentials)

print "0"
worksheet = gc.open("<name of sheet>").get_worksheet(2)
print "1"

The 0 is printed so that means the credentials and everything are loading. 0被打印出来,这意味着凭证和所有内容都在加载中。 But, when I try to load the actual sheet, with the actual name where it says "name of sheet", it doesn't actually work. 但是,当我尝试加载实际工作表时,使用“工作表名称”所在的实际名称,它实际上无法工作。 Nothing happens, and there are no errors, and it never prints 1. Am I doing something wrong? 什么都没发生,没有错误,并且从不打印1.我做错了吗? I don't think I am cause I have used this exact code for weeks, and I am suddenly having a problem. 我不认为是因为我已经使用此精确代码数周了,所以突然出现了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM