It is a program that reads Excel spreadsheet with debit and credit postings in 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:
PAG BOLETO ',' SEND TEV ',' DEP CH 24H ',' CRED TED ',' RESG POUP ',' DOC ELET E ',' DEB BASKET ',' CHEQ COMP ',' GAS ']
Question: I would like to generate a list automatically, naming each of these elements of this list, to fill them, with the respective postings, but I can not.
How to generate a variable named after an item in a list?