EasyGUI Output?

2019-09-20 04:58发布

问题:

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)