Here comes Python

Lesser known scipting language steps up to the enterprise

Among the languages favored by Web developers and innovators, particularly those in the open-source community, three of the most popular are the alliterative Pearl, PHP and Python.

Perl and PHP are popular languages, however, Python today is emerging as a powerful alternative to the more traditional choices.

Python is attractive because of its ease of use; its high level of abstraction from the hardware; its extensive support for housekeeping activities such as I/O, memory management, data typing and variable binding; and, perhaps most important, the fact that programmers can be highly productive with the language.

Python was created in the late 1980s by Dutch programmer Guido van Rossum and was named after the BBC television comedy series Monty Python's Flying Circus.

You can consider Python either a scripting language or a "regular" programming language. It offers an interactive mode for quick development and testing, as well as a noninteractive mode for ease of reuse.

In fact, Python doesn't actually contain anything new -- every feature has been taken from some other language. These practical capabilities are wrapped up in a simple package that's available for anyone to download and use without restriction; not even the GNU Public License applies.

Like Java, Python has a small core and a large, extensible library of functions and procedures. Thus, most of what a programmer is likely to need already exists in written, tested form and can be used with simple library calls glued together with a small amount of new code.

One measure of Python's programmer-friendliness is its reliance on a simple indentation hierarchy for grouping sections of code, which eliminates the need to match Begin/End statements or to count parentheses, brackets or curly braces.

Even so, Python is a general-purpose programming language that offers far more structure and support for large programs than simple shell scripts and much more error checking than lower-level languages such as C.

Python is object-oriented with built-in, high-level data types, including flexible arrays and dictionaries. It can be applied to much larger problems than languages such as Awk or even Perl can, yet it remains as easy to use as those languages.

Python's Appeal

In a 2000 interview with Linux Journal, programmer, author and open-source advocate Eric S. Raymond recounted his initial experience with Python:

"A couple of hours into the project, I noticed (allowing for pauses needed to look up new features in Programming Python) I was generating working code nearly as fast as I could type. ... This was my first clue that, in Python, I was actually dealing with an exceptionally good design. Most languages have so much friction and awkwardness built into their design that you learn most of their feature set long before your misstep rate drops anywhere near zero. Python was the first general-purpose language I'd ever used that reversed this process."

The power of Python can also be suggested by some of its users. According to Peter Norvig, director of search quality at Google Inc. in Mountain View, Calif., "Python has been an important part of Google since the beginning and remains so as the system grows and evolves."

You've also seen Python in action at your local cinema. "Python plays a key role in our production pipeline," says Tommy Burnette, a senior technical director at special-effects studio Industrial Light & Magic (ILM). "Without Python, a project the size of Star Wars Episode II would have been very difficult to pull off. From crowd rendering to batch processing to compositing, Python binds all things together."

Burnette's sentiments are echoed by Philip Peterson, ILM's principal engineer for research and development. "Python is everywhere at ILM," he says. "It's used to extend the capabilities of our applications, as well as providing the glue between them. Every [computer-generated] image we create has involved Python somewhere in the process."

Join the newsletter!

Error: Please check your email address.

More about BBC Worldwide AustralasiaExtensibilityGoogleLinuxLinux Journal

Show Comments