0
It is a program that reads Excel spreadsheet with debit and credit releases on an account.
abreexcel2.py
def leplanilha():
wb1 = oxl.load_workbook('extratomar2018.xlsx')
folhas=wb1.get_sheet_names()
print(folhas)
sheet=wb1.get_sheet_by_name('plan1')
nr=sheet.max_row
nc=sheet.max_column
for rw in range(2,nr+1):
if sheet['D'+str(rw)].value in lista:
pass
else:
lista.append(sheet['D'+str(rw)].value)
print(lista)
leplanilha():
Generated the following list:
['TEDSALARIO', 'APLIC POUP', 'CP MAESTRO', 'DOC ELET', 'DEB.IOF', 'SAQUE B24H', 'PAG FONE', 'PG PREFEIT', 'PAG AGUA', 'PAG BOLETO', 'ENVIO TEV', 'DEP CH 24H', 'CRED TED', 'RESG POUP', 'DOC ELET E', 'DEB CESTA', 'CHEQ COMP', 'SAQUE ATM', 'PG LUZ/GAS']
Question: I would like to generate a list automatically, with each of these elements of this list as its name, to fill them with their releases, but I cannot.
Generating a variable named after an item in a list?
Thank you very much Gean. I think it best to do as dictionary same.
– TCarmo