Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python,tkinter列表框_Python_Tkinter_Listbox - Fatal编程技术网

Python,tkinter列表框

Python,tkinter列表框,python,tkinter,listbox,Python,Tkinter,Listbox,我对列表框有一个问题,因为它不像1T下的第一个列表框那样显示名称,只在一行上,我想在另一行下显示一个名称。我不知道怎么做。 感谢您对下面代码的建议和关注 插入时,您需要解压缩列表 更改插入行就足够了 obecne.insert("end", *los) #^ notice this star here. That one makes the unpacking 或者,您可以使用for循环迭代列表项 obecne = Listbox(main) for

我对列表框有一个问题,因为它不像1T下的第一个列表框那样显示名称,只在一行上,我想在另一行下显示一个名称。我不知道怎么做。 感谢您对下面代码的建议和关注

插入时,您需要解压缩列表

更改插入行就足够了

obecne.insert("end", *los)
                    #^ notice this star here. That one makes the unpacking
或者,您可以使用
for
循环迭代列表项

obecne = Listbox(main)
for item in los:
    obecne.insert("end", item)
obecne.pack()
插入时,您需要解压缩列表

更改插入行就足够了

obecne.insert("end", *los)
                    #^ notice this star here. That one makes the unpacking
或者,您可以使用
for
循环迭代列表项

obecne = Listbox(main)
for item in los:
    obecne.insert("end", item)
obecne.pack()