将值列入入口小部件

发布于 2025-01-26 16:39:27 字数 482 浏览 1 评论 0原文

我试图将列表值放入入门小部件,继续获取括号和报价。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文