how do i wrire data to sqlite db via tkinter ui

Solutions on MaxInterview for how do i wrire data to sqlite db via tkinter ui by the best coders in the world

showing results for - "how do i wrire data to sqlite db via tkinter ui"
Jesús
06 Mar 2018
1l0 = tk.Label(my_w,  text='Add Student',
2              font=('Helvetica', 16), width=30,anchor="c" )  
3l0.grid(row=1,column=1,columnspan=4) 
4
5l1 = tk.Label(my_w,  text='Name: ', width=10,anchor="c" )  
6l1.grid(row=3,column=1) 
7
8# add one text box
9t1 = tk.Text(my_w,  height=1, width=10,bg='white') 
10t1.grid(row=3,column=2) 
11
12l2 = tk.Label(my_w,  text='Class: ', width=10 )  
13l2.grid(row=4,column=1) 
14
15# add list box for selection of class
16options = StringVar(my_w)
17options.set("") # default value
18
19opt1 = OptionMenu(my_w, options, "Three", "Four", "Five")
20opt1.grid(row=4,column=2)
21
22l3 = tk.Label(my_w,  text='Mark: ', width=10 )  
23l3.grid(row=5,column=1) 
24
25# add one text box
26t3 = tk.Text(my_w,  height=1, width=4,bg='white') 
27t3.grid(row=5,column=2) 
28
29radio_v = tk.StringVar()
30radio_v.set('Female')
31r1 = tk.Radiobutton(my_w, text='Male', variable=radio_v, value='Male')
32r1.grid(row=6,column=2)
33
34r2 = tk.Radiobutton(my_w, text='Female', variable=radio_v, value='Female')
35r2.grid(row=6,column=3)
36
37b1 = tk.Button(my_w,  text='Add Record', width=10, 
38               command=lambda: add_data())  
39b1.grid(row=7,column=2) 
40my_str = tk.StringVar()
41l5 = tk.Label(my_w,  textvariable=my_str, width=10 )  
42l5.grid(row=3,column=3) 
43my_str.set("Output")