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


Messages In This Thread
linking with excel - by mhmdbarazi - Apr-22-2020, 11:36 PM
RE: linking with excel - by buran - Apr-23-2020, 04:18 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  error in Linking two coroutines shankar 3 5,631 Jun-19-2020, 06:50 PM
Last Post: gogawaleankita
  Linking python to Google Sheets Charliefish1311 1 2,330 Jul-09-2019, 12:31 AM
Last Post: micseydel
  Linking with multiple python libraries poijuggler 2 3,778 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