from openpyxl.workbook import Workbook
import tkinter as tk
import pandas as pd
def saveinfo():
valor1 = entry1.get()
valor2 = entry2.get()
valor3 = entry3.get()
data.append([valor1, valor2, valor3])
print(data)
def export():
df = pd.DataFrame(data)
df.to_excel("DataBase.xlsx")
def opennewwindow():
global entry1
global entry2
global entry3
window.destroy()
newwindow = tk.Tk()
tk.Label(newwindow, text="Please, enter data: ").grid(column=0, row=0, columnspan=3)
tk.Label(newwindow, text="Number").grid(column=0, row=1)
entry1 = tk.Entry(newwindow)
entry1.grid(column=1, row=1)
tk.Label(newwindow, text="Description", ).grid(column=0, row=2)
entry2 = tk.Entry(newwindow)
entry2.grid(column=1, row=2)
tk.Label(newwindow, text="Brand").grid(column=0, row=3)
entry3 = tk.Entry(newwindow)
entry3.grid(column=1, row=3)
tk.Button(newwindow, text="Save", command=saveinfo).grid(column=2, row=2, sticky='we')
tk.Button(newwindow, text="Export", command=export).grid(column=2, row=3, sticky='we')
newwindow.mainloop()
# --- main ---
df = pd.DataFrame
data = []
window = tk.Tk()
tk.Label(window, text="Platform").grid(column=0, row=0)
tk.Button(window, text="Choose an element: ", command=opennewwindow).grid(column=0, row=1)
window.mainloop()
import tkinter as tk
import pandas as pd
def saveinfo():
valor1 = entry1.get()
valor2 = entry2.get()
valor3 = entry3.get()
data.append([valor1, valor2, valor3])
print(data)
def export():
df = pd.DataFrame(data)
df.to_excel("DataBase.xlsx")
def opennewwindow():
global entry1
global entry2
global entry3
window.destroy()
newwindow = tk.Tk()
tk.Label(newwindow, text="Please, enter data: ").grid(column=0, row=0, columnspan=3)
tk.Label(newwindow, text="Number").grid(column=0, row=1)
entry1 = tk.Entry(newwindow)
entry1.grid(column=1, row=1)
tk.Label(newwindow, text="Description", ).grid(column=0, row=2)
entry2 = tk.Entry(newwindow)
entry2.grid(column=1, row=2)
tk.Label(newwindow, text="Brand").grid(column=0, row=3)
entry3 = tk.Entry(newwindow)
entry3.grid(column=1, row=3)
tk.Button(newwindow, text="Save", command=saveinfo).grid(column=2, row=2, sticky='we')
tk.Button(newwindow, text="Export", command=export).grid(column=2, row=3, sticky='we')
newwindow.mainloop()
# --- main ---
df = pd.DataFrame
data = []
window = tk.Tk()
tk.Label(window, text="Platform").grid(column=0, row=0)
tk.Button(window, text="Choose an element: ", command=opennewwindow).grid(column=0, row=1)
window.mainloop()
No comments:
Post a Comment