Chapter 13. Writing a GUI with Python

Python plays a big role behind the scenes in some of the world's largest and most important server-side applications, but Python has also made a big impact on end-user applications. Writing a GUI is an expensive and painful project in C, C++, or even Java or C#, but it can be done quickly and easily in Python. Even if you only write simple Python scripts, being able to whip up a GUI can be a force multiplier that makes your script usable by less technical people, compounding its value. Python, being cross-platform and truly object oriented, has advantages that Visual Basic programmers would love to have in their rapid application development toolbox.

Python enables you to lay out GUIs one component at a time, like other programming languages. However, these days, no real programmer is writing GUI code by hand. If that's what you're used to, get ready to embrace all the rapid application development magic of Delphi with the power of a real language in Python. Of course, this kind of power is also available in other stacks, such as C#.

In this chapter you learn the basics of GUI programming in Python. A comprehensive guide to creating GUI applications would easily fill another book; what is contained herein merely scratches the surface. However, it should be enough to get you well on your way to writing elegant, interactive, and user-friendly applications.

In this chapter you learn to:

  • Create widgets such as labels and command, radio, and checkbox ...

Get Beginning Python®: Using Python 2.6 and Python 3.1 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.