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

Distributing the Tkinter application


So, you have your new application ready and now you want to share it with the rest of the world. How do you do that?

Of course, you need Python installation for your program to run. Windows does not come with preinstalled Python. Most modern Linux distributions and Mac OS X come preinstalled with Python, but you don't just need any version of Python. You need a version of Python that is compatible with the version on which the program was originally written.

And then, if your program uses third-party modules, you need the appropriate module installed for the required Python version. Sure this is too much diversity to handle.

Fortunately, we have tools, such as Freeze tools, which allows us to distribute Python programs as standalone applications.

Given the diversity of platforms to be handled, there is a large number of Freeze tool options from which to choose. Therefore, a detailed discussion on any one of the tools is beyond the scope of this book.

We will list some of the most evolved freezing tools in the following sections. If you find a tool fitting into your distribution requirement, you can look at its documentation for more information.

py2exe

If you only need to distribute your Python application on Windows, py2exe is perhaps the most hardened tool. It converts Python programs into executable Windows programs that can run without requiring a Python installation. More information, a download link, and tutorials are available at http://www.py2exe.org/.

py2app

py2app performs the same tasks in Mac OS X that py2exe does for Windows. If you just need to distribute your Python application on Mac OS X, py2app is a time-tested tool. More information is available at http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html.

PyInstaller

PyInstaller has gained popularity as a freezing tool in the last few years partly because it supports a wide variety of platforms, such as Windows, Linux, Mac OS X, Solaris, and AIX.

In addition, executables created using PyInstaller are claimed to take less space than other freezing tools because it uses transparent compression. Another important feature of PyInstaller is its out of the box compatibility with a large number of third-party packages.

The full list of features, downloads, and documentation can be assessed at http://www.pyinstaller.org/.

Other Freezing Tools

Other freezing tool include:

  • Freeze: This tool ships with standard Python distribution. Freeze can be used to compile executables only on Unix systems. However, the program is overly simplistic, as it fails to handle even the common third-party libraries. More information is available at this link:

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

  • cx_Freeze: This tool is similar to py2exe and py2app, but claims to be portable across all platforms on which that Python itself works. More information is available at this link:

    http://cx-freeze.sourceforge.net/index.html

    Tip

    If you're distributing a small program, a freeze tool might be just what you need. However, if you have a large program, say, with lots of external third-party library dependencies or dependencies not supported by any existing freezing tool, your application might be the right candidate for bundling the Python interpreter with your application.