Skip to content

PySimpleGUI

Sample code

import PySimpleGUI as gui # pip install pysimplegui

layout=[
    [gui.Text("First Name"),gui.Input(key="First_Name")],
    [gui.Text("Last Name"),gui.Input(key="Last_Name")],
    [gui.Button("Read"),gui.Exit()]
]

form=gui.Window("My First GUI using python",layout)

while True:
    event,values=form.read()
    if event==gui.WIN_CLOSED or event=="Exit":
        break
    if event=="Read":
        print(event,values)

form.close()
image