Good morning, all right?
As it says in the presentation of this page below, it is possible yes. I believe that there is no difference at least of the basic part between . xls and . xlsx with xlrd
XLRD Download
It would look like this:
import xlrd #importando a biblioteca
workbook = xlrd.open_workbook('teste.xls') # Escolhe o arquivo a ser lido.
worksheet = workbook.sheet_by_index(0) #Escolha a aba a ser lida.
for i in range(worksheet.nrows): #itere sobre os itens da aba
print(worksheet.row(i))
In my case, with this input spreadsheet :
I have the following output, containing the type of the value.
For more information some links.
Reading xls with python
Github library page
Reading data from a spreadsheet and sending a warning email XLRD + SMTPLIB
Hug.
Thanks friend, clear and direct example that I was passed by you, however I have another doubt, in case it has as I know through some function the number of "Sheets" present in the document? Thank you for your attention!
– Matheus Grossi
Hey, no problem at all. I already used the Workbook.sheet_names() function, it lists the sheet names, if you store in a variable, Voce can use the Len(namesake) function and check how many items there are in it. Hug
– Claudio Gonçalves Filho
Thanks for the clarification!
– Matheus Grossi