【发布时间】:2019-05-02 07:56:46
【问题描述】:
我有一个来自 mysql 请求的组合框。结果有空格的问题似乎是错误的
如果我在 mysql 中有: test1 在我的组合框中我有 test1 = OK 我的组合框中的测试 2 我有 {test 2} = 错误
#FRAME INFO
frame_info = LabelFrame (Product, text = 'Info Maker',height=240,width=1000)
frame_info.place (x=220, y=10)
combo_maker = ttk.Combobox(frame_info,state="readonly")
#combo_maker['value'] = combo_input()
combo_maker['value'] = combo_input()
combo_maker.current(0)
combo_maker.place(x=5, y=5, height = 25, width = 180)
#FRAME INFO
【问题讨论】:
-
请显示
combo_input()的结果。如果你传递一个正确的列表或元组,它应该可以正常工作。 -
显示图片。 imgur.com/nvM4wFk。是用mysql测试的。
-
不,我的意思是你的函数
combo_input的返回结果,而不是在你将它传递给组合框之后。简单的print (combo_input())并展示它是什么。 -
我有
[('test 1',), ('test 2',), ('test3',)]