Reputation: 33
i try to write the entered data from a text entry into a excel file.
if i do:
address = invoice_address_entry.get("1.0",END)
for item in address:
worksheet.write(row, col, item)
row +=1
i get the data as a column
Upvotes: 0
Views: 50
Reputation: 169388
Based on the symptoms,
address = invoice_address_entry.get("1.0",END)
returns a multi-line string. Iterating over a string yields the single characters in it.
If you want each line in it in a separate worksheet row, use .splitlines()
first.
address = invoice_address_entry.get("1.0", END)
for item in address.splitlines():
worksheet.write(row, col, item)
row += 1
Upvotes: 1