Book Image

Tkinter GUI Application Development HOTSHOT

By : Bhaskar Chaudhary
Book Image

Tkinter GUI Application Development HOTSHOT

By: Bhaskar Chaudhary

Overview of this book

<p>Tkinter is the built-in GUI package that comes with standard python distributions. This means it is easy to get started right away, without any extra installation or configuration. Tkinter’s strength lies in its simplicity of use and its intuitive nature which makes it suited for programmers and non-programmers alike. Once you get started, you will be surprised to see how a few lines of code can produce powerful GUI applications.</p> <p>Tkinter GUI Application Development Hotshot helps you learn the art of GUI programming—building real-world, productive and fun applications like text editor, drum machine, game of chess, media player, drawing application and many more. Each subsequent project builds on the skills acquired in the previous project. Also, learn to write multi-threaded and multi layered applications using Tkinter. Get to know modern best practices involved in writing GUI programs. Tkinter GUI Application Development Hotshot comes with a rich source of sample codes that you can use in your own projects in any discipline of your choice.</p> <p>Starting with a high level overview of Tkinter that covers the most important concepts involved in writing a GUI application, the book then takes you through a series of real world projects of increasing complexity, developing one project per chapter. After you have developed five full projects, the book provides you with some bare-bone skeleton codes for a few functional but incomplete projects, challenging you to put your skills to test by completing them.</p> <p>Finally, you are provided with tips for writing reusable, scalable, and quality GUI code for larger projects. The appendices provide a quick reference sheet for Tkinter.</p>
Table of Contents (16 chapters)
Tkinter GUI Application Development HOTSHOT
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Alternatives to Tkinter


In addition to Tkinter, there are several other popular Python GUI toolkits. Most popular ones include wxPython, PyQt, PySide, and PyGTK. Here's a brief discussion on these toolkits.

wxPython

wxPython is aPython interface to wxWidgets, a popular open source GUI library. Code written in wxPython is portable across most major platforms such as Windows, Linux, and Mac OS X.

The wxPython interface is generally considered better than Tkinter at building more complex GUIs primarily because it has a large base of natively supported widgets. However, Tkinter supporters do contest this claim.

The wxWidgets interface is originally written in C++ programming language, and hence, wxPython inherits a large portion of the complexity that is typical of C++ programs. wxPython provides a very large base of classes, and it often takes more code to produce the same interface than it would take in Tkinter. However, in exchange for this complexity, wxPython provides a larger base of built-in widgets than Tkinter. Moreover, some people prefer the appearance of wxPython widgets over that rendered by Tkinter.

Owing to its inherent complexity, wxPython has seen the emergence of several GUI builder toolkits, such as wxGlade, wxFormBuilder, wxDesigner, and so on.

The wxPython installation comes with demo programs that can help you get started with the toolkit quickly. To download the toolkit or for more information on wxPython, visit the following link:

http://wxpython.org/

PyQt

PyQt is a Python interface of the cross-platform GUI toolkit Qt, a project currently developed and maintained by British firm Riverbank Computing.

PyQt, with several hundred classes and thousands of functions is perhaps the most fully-featured GUI library that is currently available for GUI programming in Python. However, this feature load brings in a lot of complexity and a steep learning curve.

Qt (and hence pyQt) has a very rich set of supported widgets. In addition, it includes built-in support for network programming, SQL databases, threads, multimedia framework, regular expressions, XML, SVG, and much more. The designer feature of Qtletsus generates GUI code from a WYSIWYG (What You See Is What You Get) interface.

PyQt is available under variety of licenses including GNU, General Public License (GPL), and commercial license. However, its greatest disadvantage is that unlike Qt, it is unavailable under the LGPL.

PySide

If you are looking for a LGPL version of Qt bindings for Python, you may want to explore PySide. PySide was originally released under the LGPL in August 2009 by Nokia, the former owners of the Qttoolkit . It is now owned by Digia. More information on PySide can be obtained from the following link:

http://qt-project.org/wiki/PySide

PyGTK

PyGTK is a collection of Python bindings for the GTK + GUI library. PyGTK applications are cross-platform, and can run on Windows, Linux, MacOS X, and others. PyGTK is a free software and licensed under the LGPL. You can therefore use, modify, and distribute it with very little restrictions.

More information about PyGTK can be obtained at the following link:

http://www.pygtk.org/

Other Options

Besides these most popular toolkits, there is a range of toolkits available for GUI programming in Python.

Java programmers who are comfortable with Java GUI libraries, such as swing and AWT, can seamlessly access these libraries by using Jython . Similarly C# programmers can use IronPython to access GUI construction features from the .NET framework.

For a comprehensive list of other GUI tools available to a Python developer visit this link:

http://wiki.python.org/moin/GuiProgramming