⬅️ **[[$-Tools|Tools]]**
***
# Python PySimpleGUI Framework
- [GitHub - PySimpleGUI](https://github.com/PySimpleGUI/PySimpleGUI)
- [PySimpleGUI Docs](https://pysimplegui.readthedocs.io)
## Hello World
```python
# Part 1 - The import
import PySimpleGUI as sg
# Part 2 - The Layout
# Define the window's contents
layout = [[sg.Text("What's your name?")],
[sg.Input(key='-INPUT-')],
[sg.Text(size=(40,1), key='-OUTPUT-')],
[sg.Button('Ok'), sg.Button('Quit')]]
# Part 3 - Window Defintion
# Create the window
window = sg.Window('Window Title', layout)
# Part 4 - Event loop or Window.read call
# Display and interact with the Window using an Event Loop
while True:
event, values = window.read()
# See if user wants to quit or window was closed
if event == sg.WINDOW_CLOSED or event == 'Quit':
break
# Output a message to the window
window['-OUTPUT-'].update('Hello ' + values['-INPUT-'] + "! Thanks for trying PySimpleGUI")
# Part 5 - Close the Window
# Finish up by removing from the screen
window.close()
```
##
***
Related:
- [[$-Software|Software]]