Friday, October 3, 2025
HomeLanguagesIntroduction to PySimpleGUI

Introduction to PySimpleGUI

It is easy to use with simple yet HIGHLY customizable features of GUI for Python. It is based solely on Tkinter. It is a Python GUI For Humans that Transforms Tkinter, PyQt, Remi, WxPython into portable user-friendly Pythonic interfaces.

How can we use PySimpleGUI?

The Steps for using the GUI package PySimpleGUI are:-

  • Install PySimpleGUI
pip install PySimpleGUI 
  • Find a GUI that looks a lot similar to which you want to design and create.
  • Copy code from Cookbook.
  • Paste into your IDE and run.
  • Example: Sample Program to showcase PySimpleGUI layout.




    import PySimpleGUI as sg
       
          
    sg.theme('BluePurple')
       
    layout = [[sg.Text('Your typed characters appear here:'),
               sg.Text(size=(15,1), key='-OUTPUT-')],
              [sg.Input(key='-IN-')],
              [sg.Button('Display'), sg.Button('Exit')]]
      
    window = sg.Window('Introduction', layout)
      
    while True:
        event, values = window.read()
        print(event, values)
          
        if event in  (None, 'Exit'):
            break
          
        if event == 'Display':
            # Update the "output" text element
            # to be the value of "input" element
            window['-OUTPUT-'].update(values['-IN-'])
      
    window.close()

    
    

    Output:

    RELATED ARTICLES

    Most Popular

    Dominic
    32332 POSTS0 COMMENTS
    Milvus
    85 POSTS0 COMMENTS
    Nango Kala
    6703 POSTS0 COMMENTS
    Nicole Veronica
    11868 POSTS0 COMMENTS
    Nokonwaba Nkukhwana
    11929 POSTS0 COMMENTS
    Shaida Kate Naidoo
    6819 POSTS0 COMMENTS
    Ted Musemwa
    7080 POSTS0 COMMENTS
    Thapelo Manthata
    6775 POSTS0 COMMENTS
    Umr Jansen
    6776 POSTS0 COMMENTS