Programming With Python PDF
Programming With Python PDF
with
Python
Greg Lindstrom
W
orking in IT is the same no matter languages. In particular, he wanted a language that
the field.Whether it is communica- would be easy to extend for use with other lan-
tions, data brokerage, or any other guages. Today, the Python Software Foundation
field, IT professionals collect, (http://www.python.org/psf) holds Python’s intel-
manipulate, store, and analyze data. At NovaSys lectual property rights.The PSF also runs PyCon,
Health in Little Rock, Arkansas, we process an annual gathering of Python enthusiasts held in
healthcare claims for our customers.This includes Washington, D.C., each spring and oversees a pro-
administering claims for various insurance plans, gram of grants to advance the language.
adjudicating the claims, and paying out benefits.
The data layouts are complex, the competition ANOTHER LANGUAGE?
fierce, and the pace breakneck. Moreover, we Why do we need another programming lan-
must do the job correctly because real people are guage? Because computer science is constantly
on the end of every record advancing with newer, faster hardware, better
Python is a we touch. techniques, and—oh, yeah—the Internet.Twenty
powerful, easy-to- Approximately two years years ago, a new language called C was trying to
ago, contracted third-party replace Assembler, Cobol, and Fortran as the lan-
learn programming vendors performed most of guage of choice in the mainframe world (I know,
language based on NovaSys Health’s data pro- because I was lobbying for it). Today, Python is
cessing offsite.Although we one of several modern languages that uses these
traditional could service our clients venerable languages as a foundation while also
languages but with this arrangement, targeting current operating systems, networks,
being a small shop put us and hardware. (See the “Hello, World!” sidebar
better suited to near the bottom of most for a comparison of several current programming
contractors’ priority lists. languages.)
current operating Implementing even a simple Python provides everything I want in a pro-
systems, networks, change to a file layout could gramming language (simple text and file process-
take weeks and cost thou- ing, network operations like ftp, and a built-in GUI
and hardware. sands of dollars. Because library) and is easy to learn and understand. My
this kept us from respond- 10-year-old daughter programs her mathematics
ing to client requirements in homework in Python (she just wrote a routine to
a time frame acceptable to our senior staff, the
company decided to create an IT department to
process records in house. We chose Python
(http://www.python.org) as the primary program-
Inside
ming language for our IT needs because it is pow-
erful, well supported, and easy to learn. Hello, World!
Guido van Rossum created Python in the early The Zen of Python
1990s.To ensure a clear, easy-to-use language, van
Rossum only used ideas that had proven their
Python Resources
worth over time in other computer programming
10 IT Pro September ❘ October 2005 Published by the IEEE Computer Society 1520-9202/05/$20.00 © 2005 IEEE
Hello, World!
Figure A is a side-by-side listing of the traditional “Hello,World!” program in various languages. In an attempt to be impar-
tial,I took the following examples from Wolfram Rösler’s “Hello World Collection” (http://www.roesler-ac.de/wolfram/hello.htm),
which lists examples of “Hello,World!” in 221 programming languages.
convert degrees Celsius to degrees Fahrenheit), and last Light & Magic writes, “Python plays a key role in our
year my 12-year-old daughter wrote a routine to help solve production pipeline.Without it, a project the size of Star
word search puzzles. I have taught Python to junior and Wars: Episode II would have been very difficult to pull
senior high school students and am always impressed with off. From crown renderings to batch processing to com-
how quickly they pick up the concepts. positing, Python binds all things together.”
Many contributors to the Python mailing list are part- • Michael Muller, a software consultant, writes, “Python
time programmers using Python in their chosen profes- requires less supporting code. In most other languages,
sions. Python is so easy to learn that you will be writing a significant amount code is needed just to get to the
simple programs in a few hours and using Python at work point of implementing an algorithm. In Python this is
in a day. However, because Python is so easy to learn, many kept to a minimum: It is not necessary to declare vari-
people in the industry do not think of it as a serious lan- ables or types, create iterators and other support objects,
guage (like Perl, C++, or Java). break code into particular files, or write other support-
ing code required in languages like C++ or Java. As a
WHO’S USING PYTHON? result, Python is almost executable pseudo-code” (“At
If you are interested in who is using Python and why, visit Philips, the Semiconductor Line in Fishkill Runs on
the pythonology Web page (http://www. pythonology.org). Python,” Michael Muller, Python Success Stories, Jan.
There you can read Python success stories and quotes from 2003, www.pythonology.com/success&story=philips).
Python users. For example, • “Python has been an important part of Google since the
beginning and remains so as the system grows and
• Tommy Burnette, senior technical director at Industrial evolves,” writes Peter Norvich, director of search quality.
IEEE save
Computer Society
members
25 %
m e m b e r ?
on all conferences
o n l i n e
t o d a y !
sponsored by the
IEEE
J o i n
a
Computer Society
N o t
w w w. c o m p u t e r. o r g / j o i n
SCHOLARSHIP
MONEY FOR
STUDENT LEADERS
Lance Stafford Larson Student Scholarship best paper contest
✶
Upsilon Pi Epsilon/IEEE Computer Society Award for Academic Excellence
Each carries a $500 cash award.
Application deadline: 31 October
Investing in Students
www.computer.org/students/