Python GUI 库介绍-PySimpleGUI

发布时间 2023-04-04 09:01:42作者: 张喆坤

1.pip install PySimpleGUI

2.coding

import PySimpleGUI as sg

layout =[
    [sg.Text("HELLO PySimpleGUI")],
    [sg.Text("姓名"),sg.InputText("张喆坤")],
    [sg.Text("性别"),sg.InputText("N\A")],
    [sg.Text("年龄"),sg.InputText("27")],
    [sg.Button("确定"),sg.Button("取消")],
]

window=sg.Window("Python gui",layout)
while True:
    envent,values=window.read()
    if envent ==None:
        break
window.close()