EasyGUI输出? [英] EasyGUI Output?

查看:403
本文介绍了EasyGUI输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对...所以,我有两个列表.一个有16个条目.另一个至少有几百个.使用EasyGUI输出它们非常简单,可以使用textbox()函数或msgbox()函数.问题是我希望它每行显示一个列表项,而不是一个巨大的斑点.我将如何实现呢?

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?

下面是代码示例:

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

combinations是一个包含约100-200个条目的列表(取决于情况) 每个条目都是一个字符串.

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

推荐答案

使用'\n'.join

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

这篇关于EasyGUI输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆