第98行上的“ navigate_sheet函数”第99行未显示工作表列表
我不太确定尝试什么
class InputData:
def __init__(self):
# use creds to create a client to interact with the Google Drive API
self.scope = ['https://spreadsheets.google.com/feeds',
'https://www.googleapis.com/auth/drive']
self.creds = ServiceAccountCredentials.from_json_keyfile_name('client_secret.json', self.scope)
self.client = gspread.authorize(self.creds)
self.sheet = ""
self.error = "[!] There was a critical error that broke the program!"
def navigate_sheet(self):
worksheet_list = self.sheet.worksheets()
print(worksheet_list)
此的预期结果:
显示工作表的列表实际结果:“ AttributeError:“工作表”对象没有属性“工作表””
我认为您忘记了初始化sheet
数据成员。