多个窗口
import PySimpleGUI as sg
# Create some widgets
ok_btn = sg.Button('Open Second Window')
cancel_btn = sg.Button('Cancel')
layout = [[ok_btn, cancel_btn]]
# Create the first Window
window = sg.Window('Window 1', layout)
win2_active = False
# Create the event loop
while True:
event1, values1 = window.read(timeout=100)
if event1 in (None, 'Cancel'):
# User closed the Window or hit the Cancel button
break
if not win2_active and event1 == 'Open Second Window':
win2_active = True
layout2 = [[sg.Text