Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Update database in tkinter
#3
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()
Yoriz write Oct-24-2020, 03:35 PM:
Please post all code, output and errors (in its entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply


Messages In This Thread
Update database in tkinter - by shahulvk - Oct-20-2020, 11:31 AM
RE: Update database in tkinter - by Larz60+ - Oct-20-2020, 05:41 PM
RE: Update database in tkinter - by shahulvk - Oct-24-2020, 02:53 PM
RE: Update database in tkinter - by shahulvk - Oct-24-2020, 04:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  wrong entries in sqlite database and tkinter epsilondatum 2 398 Apr-23-2024, 04:48 PM
Last Post: epsilondatum
  Get last row of SQL database and update Turtle 5 3,247 Oct-14-2021, 07:06 PM
Last Post: Turtle
Question Python + Google Sheet | Best way to update specific cells in a single Update()? Vokofe 1 2,725 Dec-16-2020, 05:26 AM
Last Post: Vokofe
  How to update sql database from csv Prince_Bhatia 0 2,613 Feb-09-2019, 09:15 PM
Last Post: Prince_Bhatia
  add content of database to text widgte with update atlass218 1 2,620 Jan-06-2019, 02:13 AM
Last Post: woooee
  How to update only two colums in database from csv without touching data in other col Prince_Bhatia 0 2,298 Aug-21-2018, 09:13 AM
Last Post: Prince_Bhatia
  problem with select and update the data into the database chris0147 1 3,216 Aug-18-2017, 09:38 PM
Last Post: chris0147
  Search the data to update in a database chris0147 7 6,814 Oct-27-2016, 03:16 PM
Last Post: Ofnuts
  update the data into the database chris0147 3 6,285 Oct-19-2016, 12:12 AM
Last Post: Yoriz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020