我想通过一些按钮创建一个数据库
def functie(Tip_suprafata, Prelucrare):
with open('employee_file2.csv', mode='w') as csv_file:
fieldnames = ['Tip_suprafata', 'Prelucrare']
reader = csv.reader(csv_file, delimiter=' ', quotechar='|')
writer = csv.DictWriter(csv_file, fieldnames=fieldnames)
class Pag1(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
label = tk.Label(self, text="Alege prelucrarea")
label.pack(pady=20,padx=20)
self.controller = controller
label = tk.Label(self, text="This is page 1")
button = tk.Button(self, text="Găurire", command=lambda: functie('conica2', 'gaurire'))
button1 = tk.Button(self, text="Frezare",
command=lambda: functie('conica3', 'gaurire2'))
button2 = tk.Button(self, text="Rectificare",
command=lambda: functie('conica4', 'gaurire6'))
button.pack()
button1.pack()
button2.pack()
class Pag2(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
label = tk.Label(self, text="Alege prelucrarea")
label.pack(pady=20,padx=20)
self.controller = controller
label = tk.Label(self, text="This is page 2")
button = tk.Button(self, text="Găurire", command=lambda: functie('bulangerie', 'gaurire'))
button.pack()
row_count = sum(1 for row in open('employee_file2.csv'))
writer.writeheader()
writer.writerow({'Tip_suprafata': Tip_suprafata, 'Prelucrare': Prelucrare})
目前没有回答
相关问题 更多 >
编程相关推荐