Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
linking with excel
#1
hello everyone
I linked my python code with an excel sheet, I inserted the library and the compiler could read values from the sheet.
but the problem is when I wanted to put these values in a list this error message came out to me:

Error:
AttributeError: 'list' object attribute 'append' is read-only
and the code is:
import xlrd

file_location = "C:/Users/Hp/Documents/sample_grid.xlsx"

workbook = xlrd.open_workbook(file_location)

sheet = workbook.sheet_by_index(0)
ppv=[]

for r in range(sheet.nrows):
   ppv.append = (sheet.cell_value(r ,3))

print(ppv)
-----------------------------------------------------------------------------------------
I tried in different ways but dealing with excel files is really hard and changes from file to file
if anyone can help thanks in advance Smile
Reply
#2
ppv.append(sheet.cell_value(r ,3))
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  error in Linking two coroutines shankar 3 5,565 Jun-19-2020, 06:50 PM
Last Post: gogawaleankita
  Linking python to Google Sheets Charliefish1311 1 2,298 Jul-09-2019, 12:31 AM
Last Post: micseydel
  Linking with multiple python libraries poijuggler 2 3,746 Oct-13-2017, 02:52 PM
Last Post: poijuggler

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020