Table of Contents
If you have read this book thoroughly till now and practised writing a lot of programs, then you must have become very comfortable and familiar with Python. You have probably created some Python programs to try out some stuff and to exercise your Python skills as well. You have already seen how to create a backup script as well. The question now is "What Next?"
I would suggest that you tackle this problem : create your own command-line address-book program using which you can add, modify, delete or search for your contacts such as friends, family and colleagues and their information such as email address and/or phone number. Details must be stored for later retrieval.
This is fairly easy if you think about it in terms of all the various stuff that we have come across till now. If you still want directions on how to proceed, read the following hint. (Hint: Create a class to represent the person's information. Use a dictionary to store person objects with their name as the key. Use the cPickle module to store the objects persistently on your hard disk. Use the dictionary built-in methods to add, delete and modify the persons.)
Once you are able to do this, you can claim to be an accomplished programmer. Now, immediately send me a mail thanking me for this great book ;-). This step is optional but highly recommended!
Here are some ways to continue your journey with Python:
GUI Libraries using Python - you need these to create your own graphical programs using Python. You can create your own Winamp or IrfanView (Windows users should be familiar with these) or your own XMMS or KOrganizer (Linux/BSD users should be familiar with these) using these GUI (graphical user interface) libraries with their Python bindings. Bindings are what allow you to write programs in Python using libraries which themselves are written in C or C++ such as all the GUI libraries we mention below.
There are lots of choices for GUI using Python:
PyQt. This is the Python binding for the Qt toolkit which is the foundation upon which KDE is built. Qt is extremely easy to use and very powerful because of the excellent Qt Designer and the amazing Qt documentation. You can use it for free on Linux but you will have to pay for it if you want to use it on Windows. PyQt is free if you want to create free (GPL'ed) software and paid if you want to create proprietary software. A good resource on PyQt is GUI Programming with Python .
PyGTK. This is the Python bindings for the GTK+ toolkit which is the foundation upon which GNOME is built. GTK+ has many quirks in usage but you can become really productive with it once you get used to it. The Glade graphical interface designer is indispensable. The documentation is yet to improve. GTK+ works well on Linux but it's port to Windows is incomplete. You can create both free software as well as proprietary software using GTK+.
wxPython. This is the Python bindings for the wxWidgets toolkit. wxPython has a learning curve associated with it but it is very portable and runs on Linux, Windows, Mac as well as some embedded platforms and all this without any changes to your code. There are many excellent IDEs for wxPython which include GUI designers as well, such as the Boa Constructor and the spe (Stan's Python Editor) as well as the free wxGlade GUI builder. You can create free as well as proprietary software using wxPython.
PythonCard. Many readers have suggested that PythonCard is a very good alternative for basic GUI programs. It is actually a layer over wxPython.
TkInter. TkInter is one of the oldest GUI toolkits. If you have used IDLE, you have seen a TkInter program at work. The documentation for TkInter at PythonWare.org is comprehensive. TkInter is portable and works on both Linux as well as Windows.
Unfortunately, there is no one standard GUI tool for Python. I suggest that you choose one of the above tools depending on your situation. The first factor is whether you are willing to pay to use any of the GUI tools. The second factor is whether you want the program to run on Linux or Windows or both. The third factor is whether you are a KDE or GNOME user on Linux.