using SQL trying to delete a client from a table that is input through a tkinter listbox and I'm getting this error:
TypeError: 'str' object is not callable`
this is the code i'm working with:
class delete_client:
def __init__(self):
self.window = Tk()
self.window.wm_protocol("WM_DELETE_WINDOW", self.close)
self.window.title("Delete Clients")
self.delete_client_lst = Listbox(self.window, width=50, height=15)
self.delete_client_lst.grid(row=0, column=0, sticky=W, columnspan=2, padx=10, pady=3)
self.delete_button = Button(self.window, text='Delete Client', command = self.delete)
self.delete_button.grid(row=4,column = 2,sticky =E)
self.surname_lbl = Label(self.window, text='Client Surname')
self.surname_lbl.grid(row=2, column=0)
self.surname_entry = Entry(self.window, width=10)
self.surname_entry.grid(row=2, column=1)
def delete(self):
given_surname = self.surname_entry.get()
sql = "DELETE FROM Client"
sql = "WHERE Surname = %s" (given_surname)
c.execute(sql)
def close(self):
self.window.destroy()
thanks