将值列入入口小部件
我试图将列表值放入入门小部件,继续获取括号和报价。
lista = ['abc', 'def', 'ghi']
# These are normally strings, but can be integer
entrya = Entry(window, width=20)
entrya.insert(0, lista[0])
# This should put abc into entrya widget box, seems to put ['abc']
entrya.place(relx=0.1, rely=0.1)
entryb = Entry(window, width=20)
entryb.insert(0, lista[1])
entryb.place(relx=0.1, rely=0.3)
entryc = Entry(window, width=20)
entryc.insert(0, lista[2])
entryc.place(relx=0.1, rely=0.6)
I am trying to put list values into entry widgets, keep getting brackets and quotes.
lista = ['abc', 'def', 'ghi']
# These are normally strings, but can be integer
entrya = Entry(window, width=20)
entrya.insert(0, lista[0])
# This should put abc into entrya widget box, seems to put ['abc']
entrya.place(relx=0.1, rely=0.1)
entryb = Entry(window, width=20)
entryb.insert(0, lista[1])
entryb.place(relx=0.1, rely=0.3)
entryc = Entry(window, width=20)
entryc.insert(0, lista[2])
entryc.place(relx=0.1, rely=0.6)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论