Oct-24-2020, 02:53 PM
(This post was last modified: Oct-24-2020, 03:35 PM by Yoriz.
Edit Reason: Added code tags
)
This is my code:-
import sqlite3 from tkinter import * from tkinter import messagebox def enter(): root.geometry('650x850') conn = sqlite3.connect('ceregister.db') c = conn.cursor() c.execute("SELECT name FROM register") table=c.fetchall() for i in range(len(table)): #Rows #for j in range(width): #Columns b = Entry(root) b.grid(row=7+i, column=0) b.insert(0,table[i]) b.configure(state='disabled') c = Entry(root) c.grid(row=7+i,column=1,sticky=W) conn.close() root=Tk() root.geometry('500x300') root.title("CE Maker Vr. 2021") lblname=Label(root,text="Name of the Teacher: ") lblname.grid(row=0,column=0,pady=20) lblsubject=Label(root,text="Subject: ") lblsubject.grid(row=1,column=0,sticky=E) txtteacher=Text(root,width=25,height=1) txtteacher.grid(row=0,column=1) txtsubject=Text(root,width=25,height=1) txtsubject.grid(row=1,column=1) lblclass=Label(root,text="Class: ") lblclass.grid(row=2,column=0,pady=20,sticky=E) #btnsave=Button(root,text="Save Marks",command=savemark) #btnsave.grid(row=0,column=3) btnenter=Button(root,text="Enter CE Marks", command=enter) btnenter.grid(row=3,column=1,columnspan=2,sticky=EW) root.mainloop()