EasyGUI Output?

送分小仙女□ 提交于 2019-12-13 08:32:43

问题


Right...so, I have two lists. One has 16 entries. The other at least has a couple hundred. Outputting them with EasyGUI is easy enough, with either a textbox() function or msgbox() function. The problem is that I want it to display with one list item per row, instead of a huge blob. How would I achieve this?

Here's an example of the code:

def print_comb_GUI(combinations):
    eg.textbox(combinations) #eg = EasyGUI

combinations is a list with about 100-200 entries (it depends) Every entry is a string.


回答1:


use '\n'.join

>>> import easygui as ea
>>> big_list = ['this', 'is', 'no', 'so', 'big']
>>> text = '\n'.join(big_list)
>>> ea.textbox(text=text)


来源:https://stackoverflow.com/questions/10058621/easygui-output

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!