I am trying to write to an excel file (LibreOffice Calc not actually excel). I am trying to save historical data and then graph for status updates at our quarterly meetings (I can get the information to the graph when formatted correctly so that isn't an issue).
However, I'm running into an issue when I press a button on my Tkinter window the information I want to be written is recorded in my excel file but every time I push the button it overwrites the first row. Below is an oversimplified example of my code. I have no idea what else to add to my def function to return to a new line so I don't overwrite my information. Thoughts?
from tkinter import *
from openpyxl import Workbook
def excel ():
wb=Workbook()
ws=wb.active
cellx='A1'
ws[cellx]=E1.get()
wb.save("sample.xlsx")
#Assumeing I need something similar to ws.cell(row=cellx+1) but it doesn't work.
root=Tk()
L1=Label(root,text="Tester")
E1=Entry(root,width=10)
b1=Button(root,text="Save",command=excel)
L1.pack()
E1.pack()
b1.pack()
root.mainloop()
In the actual code, there will be some entry boxes that contain words and some that will only contain numbers.