Drill-down on Three Major New Modules in Python 2.5 Standard Library
The freshly minted 2.5 version of Python has lots of goodies, but the three in this article are the cream of the crop. Find out how ctypes, pysqlite, and ElementTree can save you time and aggravation in this extensive article with a ton of great sample code.
by Gigi Sayfan
November 22, 2006
his article is the second part in a three-part series about Python 2.5. The first part discussed the major changes and enhancements to the Python language itself. This part introduces the main modules that were added to the Python standard library. The third part will discuss a whole bag of smaller improvements and changes that are relevant to specific subsets of the Python community.
Python has a vibrant community that produces lots of useful packages and modules. The best onesthe ones that have proven themselves in the fieldsometimes get included in the standard Python library. This is important for several reasons:
High availabilityPeople who deploy large Python-based systems that rely on standard modules only have it easy when it comes to installation, deployment, and upgrades.
High visibilityBeing included in the standard library means that the module will be documented in the official Python documentation as well as in Python books. Example programs and articles are more likely to use standard modules because they don't require special installation (see point 1).
Blessed statusIf there are multiple modules that provide some functionality then the module picked for inclusion in the standard library obviously has been deemed better.
There are three modules recently included in the standard library that I'll discuss in this article: ctypes, pysqlite, and ElementTree.
ctypes allows calling C functions in dynamic/shared libraries without writing extensions.
Pysqlite is a great embedded database package.
ElementTree is a pythonic and efficient set of XML processing tools.
Arguably, these modules are the most important for the majority of Python users. I'll discuss the hashlib and wsgiref modules, which are also important, in a third article (coming soon).
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!