In version 3.0 of my address book I'm utilizing tkinter. The only problem thus far I'm having is that I have a very ugly display on a child window that shows the search result for a query. I'm getting
{Shoiukamp0@gmail.com[/email], Phone: (111)555-2222, Address: 122 C---- Ct., Essex, VT']}
The issue is that I'm looking for the text without the curly braces and list brackets, I tried substringing it but then nothing is displayed. Below are the segments of code related to this, note that searchfor for is a class method, also not that I'm aware that modifying the class attributes is not the best way to do this, but it worked best for me to make the child's label(this strategy is not my issue at hand).
def searchfor(self):
query= self.search.get().capitalize()
if query in ab.book:
Interface.result=query.capitalize(),':',ab.book[query]
else:
Interface.result='Query not found.'
print(Interface.result)
show()
class Display_contact(Frame):
'''Show a contact'''
def __init__(self,master):
super(Display_contact, self).__init__(master)
self.grid()
self.create_widget()
def create_widget(self):
self.contact=Label(self,text=Interface.result)
self.contact.grid()
How could I go about making Interface.result ab.book[query] without the {[]}?
Thanks for the advice!