简体   繁体   中英

gspread spreadsheet not loading, no errors

I am writing a python script using gspread. 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. 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? I don't think I am cause I have used this exact code for weeks, and I am suddenly having a problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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