i created a database by follwing program in python… now i want to delete a row from this table(that is first name,lastname and id of one person and that is a label).what shoud i di? please help
from tkinter import *
import sqlite3
conn = sqlite3.connect('bmidatabase.db')
c = conn.cursor()
class App:
def __init__(self,master):
## frame = Frame(master)
## frame.pack()
self.master=master
a= StringVar()
b= StringVar()
a1= StringVar()
b1= StringVar()
c= StringVar()
self.button = Button(self.master,text="open", fg="red", command=self.ouvrir)
self.button.pack(side=LEFT)
self.button2 = Button(self.master,text="create", command=self.tabluh)
self.button2.pack(side=LEFT)
self.button3 = Button(self.master,text="close DB", command=self.fermer)
self.button3.pack(side=LEFT)
self.button31=Button(self.master,text="Exit",fg='red',command=self.exit)
self.button31.pack(side=LEFT)
self.button4 = Button(self.master,text="insert rec", command=self.insertar)
self.button4.pack(side=LEFT)
self.button5 = Button(self.master,text="list rec", command=self.listar)
self.button5.pack(side=LEFT)
self.a = Entry(self.master)
self.a.pack(side=BOTTOM)
self.b = Entry(self.master)
self.b.pack(side=BOTTOM)
self.c = Entry(self.master)
self.c.pack(side=BOTTOM)
def ouvrir(self):
self.con=sqlite3.connect('maddb')
self.cur=self.con.cursor()
def tabluh(self):
c.execute('''CREATE TABLE xxx(id INTEGER,firs stringvar(10),las stringvar(10))''')
def fermer(self):
self.con.close()
def insertar(self):
a1=self.a.get()
b1=self.b.get()
c1=int(self.c.get())
c.execute("INSERT INTO xxx (id, firs,las ) VALUES (?, ?, ?)",(c1, a1, b1))
conn.commit()
def listar(self):
c.execute('SELECT * FROM xxx')
print(c.fetchall())
def exit(self):
#Exit protocol for the exit button. This part is completely done.#
self.master.destroy()
root = Tk()
root.title("Dbase")
app=App(root)
root.mainloop()