Book Review: Python Standard Library
When I offered to review Python Standard Library, I expected to find a dull list of library functions with dry descriptions of their arguments. I was pleasantly surprised, though, when I started reading the book. The author claims to spend hundreds of hours answering questions on the comp.lang.python Usenet newsgroup. It shows.
Rather than the dry manual I expected, this book is filled with useful examples. It is comprehensive, with the exception of not covering Tkinter. This seems like a reasonable decision considering that the majority of Python users will not use Tkinter, and it would take a lot of space to document. In fact, Fredrik is working on a separate book on Tkinter.
Python Standard Library is divided into 14 chapters, each covering a related set of modules. As the book is comprehensive there is no reason to enumerate its contents here, but the divisions are quite logical. For example, there are chapters on threads and processes as well as mail and news message processing. Two chapters, "Platform-Specific Modules" and "Implementation Support Modules", cover the non-generic modules.
To give you a feeling for the book, I will describe two specific sections in detail.
The first section is called "The string Module", from the "Core Modules" chapter. This section is a little under two pages, the majority of which is code. After a once-sentence description, you are presented with an example. The example includes the file name (so you can find it on the CD), about ten lines of code and the result of executing the code. The code is mainly print statements with a text string passed to the various functions of string, e.g., string.upper, string.lower, string.split, string.count.
Next comes a brief description of differences between Python 1.5.2 and later versions. As the main difference is the availability of string methods in the later versions of Python, a new example is included that shows the same code written to use string methods instead of string module functions.
A third description and example explains the additional capabilities of the string module for converting other data types to strings. The final paragraphs describe how you can use the int and float functions as an alternative to the string module counterparts.
As a second example, I have selected "The cgi Modules" from the "Network Protocols" chapter. This description is about 1.5 pages long and includes two short paragraphs of text, followed by a listing. The listing is a CGI script that returns a list of files in a specified directory. It uses os.environ.get to grab the QUERY_STRING, os.listdir to get the file names and cgi.escape to clean up strings.
While the example is cleanly written and does what it says it should, I was a little disappointed that it did not go into all the functionality of the cgi module. For example, it mentions that the module can parse CGI form data, but there is no description or example of how to do this.
The CD is a logical addition, it includes all the scripts found in the book. In addition, it contains prebuilt Python 2.0 distributions for Windows and x86 Linux (in RPM format), plus a demo copy of PythonWorks Pro 1.2 for the same two platforms.
PythonWorks is an integrated development environment (IDE) for Python. The included software runs in demo mode, limiting what you can do with the included projects. However, you can get a free, time-limited Evaluation Ticket from the Pythonware web site, so you can see how it runs on your project.
Overall, the book is packed with a lot of practical information. The text seems accurate--the only typo I found was grammatical and insignificant. It doesn't answer every question readers might have, but for its size and readability it does a good job. Unlike some books I have seen on other programming languages--where readers are handed a lot of code but figuring out what it does and what it is related to is left to them--I found all the examples in this book relevant to the subjects being addressed.
As long as you don't expect to find everything in one book, I expect you will be satisfied. If, however, you just must have all the information in one book, the Python Developer's Handbook (reviewed in the February 2001 issue of Linux Journal) may be the better choice.
Phil Hughes is the publisher of Linux Journal.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- SUSE LLC's SUSE Manager
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- My +1 Sword of Productivity
- Managing Linux Using Puppet
- Non-Linux FOSS: Caffeine!
- Doing for User Space What We Did for Kernel Space
- SuperTuxKart 0.9.2 Released
- Google's SwiftShader Released
- Parsing an RSS News Feed with a Bash Script
- Rogue Wave Software's Zend Server
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide