【发布时间】:2021-03-30 09:22:33
【问题描述】:
如何在弹出的文本输出中显示函数的结果?
import PySimpleGUI as sg
FILMS = [["There will be blood", "Paul Thomas Anderson", 2007],
["Lion King","Rob Minkoff", 1994],
["Toy Story","Josh Cooley",1995],
["Monty Python's Life of Brian","Terry Jones",1979],
["Die Hard","John McTiernan",1988],
["Rocky","John G. Avildsen",1976]]
def listprint():
for i in range (len(FILMS)):
print(FILMS[i][0])
event, values = sg.Window('Find a film', [[sg.Text('Are you ready:')],[sg.B("OK",key="-OK-"), sg.B("Return",key="-Return-")] ]).read(close=True)
if event == '-OK-':
sg.popup('Film names will be printed in the python output:',command = listprint)
【问题讨论】:
标签: python python-3.x pysimplegui