

Then you create the window and pass in your custom layout. In this case, you add a Text() element and a Button() element. PySimpleGUI uses nested Python lists to lay out its elements.
SIMPLY FORTRAN GUI EXAMPLES HOW TO
If you’d like to learn more about wxPython, then check out How to Build a Python GUI Application With wxPython. For example, wxPython uses Sizers to lay out elements dynamically. Most GUI toolkits allow you to lay out the elements using absolute positioning or by allowing the GUI to lay them out dynamically. read () # End program if user closes window or # presses the OK button if event = "OK" or event = sg. Window ( "Demo", layout ) # Create an event loop while True : event, values = window. # hello_psg.py import PySimpleGUI as sg layout =, ] # Create the window window = sg. PySimpleGUI is still quite powerful and can get most things done with a little work. But don’t let this stop you from giving PySimpleGUI a try.

For more information about Tkinter, check out Python GUI Programming With Tkinter.ĭepending on which variant of PySimpleGUI you use, applications that you create with PySimpleGUI may not look native to their platform. When you install PySimpleGUI, you get the Tkinter variant by default.

PySimpleGUI has wrapped most of PySide2, but only a small portion of wxPython. PySimpleGUI wraps the entirety of Tkinter, which comes with Python. However, each of the ports has to be installed separately. PySimpleGUI wraps portions of each of these other packages and makes them easier to use. PySimpleGUI was launched in 2018, so it’s a relatively new package compared with the likes of wxPython or PyQt. Free Bonus: Click here to get our free Python Cheat Sheet that shows you the basics of Python 3, like working with data types, dictionaries, lists, and Python functions.
