Python-从多维列表中搜索并在TKINTER小部件上显示
这是我的列表:
contactlist = [
['Person1 Lastname1', '123123', 'Random City 1'],
['Person2 Lastname2', '246810', 'Random City 2'],
['Person3 Lastname3', '13579123', 'Random City 3'],
]
我有一个tkinter小部件,用户可以在其中输入名称以及显示搜索结果的位置。
Label(root,text = 'NAME',font = 'arial 12 bold',bg = 'SlateGray3').place(x=30,y=20)
Entry(root,textvariable = Name).place(x = 100,y = 20)
我要做的是每当用户输入窗口小部件(名称),然后按“搜索”按钮时,它将在小部件中显示全名。我该怎么做?
编辑:有关目标的更多澄清
This is my list:
contactlist = [
['Person1 Lastname1', '123123', 'Random City 1'],
['Person2 Lastname2', '246810', 'Random City 2'],
['Person3 Lastname3', '13579123', 'Random City 3'],
]
I have a TKinter Widget where the user can input a name and where the search result would be displayed.
Label(root,text = 'NAME',font = 'arial 12 bold',bg = 'SlateGray3').place(x=30,y=20)
Entry(root,textvariable = Name).place(x = 100,y = 20)
What i want to do is whenever the user inputs something in the widget (name), and then press the "search" button, it will display the full name in the widget. How do i do this?
Edit: More clarifcation on objective
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试使用此程序,只是一个原始界面,您可以自己对其进行样式。
您也可以自动替换
为
更新内容
You can try using this program, just a raw interface you can style it yourself.
You can also replace
with
To update contents automatically