PySimpleGUI
Python GUIs for Humans
安装库 Install
[PowerShell] 纯文本查看 复制代码 pip install pysimplegui
示例代码 This Code
[Python] 纯文本查看 复制代码 import PySimpleGUI as sgsg.theme('DarkAmber')
# Add a touch of color
# All the stuff inside your window.
layout = [ [sg.Text('Some text on Row 1')],
[sg.Text('Enter something on Row 2'), sg.InputText()],
[sg.Button('Ok'), sg.Button('Cancel')] ]
# Create the Window
window = sg.Window('Window Title', layout)
# Event Loop to process "events" and get the "values" of the inputswhile True:
event, values = window.read()
if event == sg.WIN_CLOSED or event == 'Cancel':
# if user closes window or clicks cancel
break
print('You entered ', values[0])
示例窗口 Makes This Window
|