Use a variable to choose a dictionary to search in Python 3 and Tkinter? -


i have got customers, e.g. customer1. , have stored data in dictionary this:

customer1 = {"age": 20, "gender": "male",} 

i want have tkinter entry box , text variable called searchterm:

searchterm = stringvar() entry = entry(frame, textvariable=searchterm) 

then want able find dictionary using value typed in , display data in text widget.

i'm new python please help.

assuming have frame called frame1

#create text present result , entry input  text1 = text(frame1,bg="white",width=60) entry1 = entry(frame1,bg="yellow")  #the handler necessary process input  def handler1(event):         text1.delete(1.0,end)         data=entry1.get()         #what ever want data#         #get result...#         text1.insert(result)  #a button engage function input  b1=button(self,text="open",width=20) b1.bind("<button-1>",handler1) 

Comments

Popular posts from this blog

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -