Skip to content Skip to sidebar Skip to footer

Selected Row Record How To Diplayed Relavent Entry Python

i am a beginner of python programming.i am making crud system on python.while make a system ran into the problem with if i select the row record from table selected row record disp

Solution 1:

I just defined two function called work() and clear() and gave it buttons

Button(root, text="work",command = work,height=3, width= 13).place(x=140, y=130)
Button(root, text="Clear",command = clear,height=3, width= 13).place(x=350, y=130)

and then...

def work():
    row_id = listBox.selection()[0]
    select = listBox.set(row_id)
    e1.insert(0,select['id'])
    e2.insert(0,select['stname'])
    e3.insert(0,select['course'])
    e4.insert(0,select['fee'])

def clear():
    e1.delete(0,END)
    e2.delete(0,END)
    e3.delete(0,END)
    e4.delete(0,END)

If you dont want to use button, then try this

listBox.bind('<Double-Button-1>',work)

and pass in event as a parameter like def work(event):

Try adding these and let me know

Cheers

Post a Comment for "Selected Row Record How To Diplayed Relavent Entry Python"