Hi stackoverflow community, I am new to python. I want to edit a google spreadsheet using gspread. The following is the code I am using:
import json
import gspread
from oauth2client.service_account import ServiceAccountCredentials
json_key = json.load(open('My Project-f3f034c4a23f.json'))
scope = ['https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name('My Project-f3f034c4a23f.json', scope)
gc = gspread.authorize(credentials)
worksheet = gc.open('Roposo')
worksheet.update_acell('B1', 'Gspread!')
I am getting the error:
Traceback (most recent call last): File "C:\Users\user\Desktop\Python\spreadsheet.py", line 16, in cell_list = worksheet.range('A1:C7') AttributeError: 'Spreadsheet' object has no attribute 'range'
Please tell a suitable solution.