PySimpleGui 输出标题栏名称问题

PySimpleGui Output Title Bar Name Problem

我想使用 pysimplegui 打印类似这样的输出

import PySimpleGUI as sg
print("The age of the universe is", age_of_universe, "Gyr")
print("The age of universe at z = ", z, "is", age_of_universe_at_z,)
print("Lookback time is", lookback_time , "Gyr")
print("Comoving distance to an object at z =", z , "is" , comoving_distance, "Mpc")
print("Luminosity distance to an object at z =", z, "is", luminosity_distance, "Mpc")
print("Angular diameter distance to an object at z =", z, "is", angular_distance, "Mpc")

我试过用弹窗的方式。不过这次弹出里面写的东西变成了标题栏的名字

sg.popup('This is the modified LightGreen3 Theme', 'It has black button text')

那么我怎样才能打印这些东西,并且可以随意命名标题栏。

谢谢。

注意:我可以接受使用 tkinter 提供的解决方案,但我更喜欢 pysimpleguı

在 PySimpleGUI 中,当您想要设置标题栏文本时要查找的参数是 title。所有的弹出窗口都有一个标题参数,就像 Window object 那样。

这个弹出窗口 window 有一个标题:

用于制作它的代码是:

sg.popup('This is a popup.....Make sure it is long enough to see title.', title='My own title')

您可以在主文档中找到弹出参数的说明,http://www.PySimpleGUI.org