Adding GUI elements to Python scripts

GUI Treatment

Author(s):

If you need to add graphical elements to Python script, EasyGUI can help beginners and experts alike.

When it comes to wrapping up Python scripts into a graphical interface, you have several options, including Tkinter, wxPython, PySide, and PyGTK, but using these libraries is overkill if you just want to add a few GUI elements to a Python script to make it more user friendly.

In this case, EasyGUI is a much better tool for the job because it allows you to add common graphical elements without going through the rigmarole of coding GUI by hand. For example, a simple task like displaying a message box using the PyGTK toolkit requires a hefty chunk of code (see Listing 1).