【发布时间】:2017-03-30 09:42:37
【问题描述】:
from tkinter import *
from tkinter.messagebox import showinfo
def output():
yield 'The %s line' % ('first')
yield '\n'
yield 'The %s line' % ('second')
def reply():
showinfo(title='Log size', message=(list(output())))
window = Tk()
button = Button(window, text='Get info', command=reply)
button.pack()
window.mainloop()
返回this。
如何使输出看起来更好:
第一行
第二行
我尝试将 message 作为 list(i for i in output()),但结果是一样的。
【问题讨论】:
标签: python tkinter window output