Building Skills in Python, Release 2.6.5
to operating system API‘s. It supports integration of complex solutions from pre-built components. It is a
dynamic language, which avoids many of the complexities and overheads of compiled languages.
This book is a close-to-complete presentation of the Python language. It is oriented toward learning, which
involves accumulating many closely intertwined concepts. In our experience teaching, coaching and doing
programming, there is an upper limit on the “clue absorption rate”. In order to keep within this limit, we’ve
found that it helps to present a language as ever-expanding layers. We’ll lead you from a very tiny, easy to
understand subset of statements to the entire Python language and all of the built-in data structures. We’ve
also found that doing a number of exercises helps internalize each language concept.
Three Faces of a Language. There are three facets to a programming language: how you write it, what
it means, and the additional practical considerations that make a program useful. While many books cover
the syntax and semantics of Python, in this book we’ll also cover the pragmatic considerations. Our core
objective is to build enough language skills that good object-oriented design will be an easy next step.
The syntax of a language is covered in the language reference manual available online. In the case of relatively
simple languages, like Python, the syntax is simple. We’ll provide additional examples of language syntax.
The semantics of the language can be a bit more slippery than the syntax. Some languages involve obscure
or unique concepts that make it difficult to see what a statement really means. In the case of languages
like Python, which have extensive additional libraries, the burden is doubled. First, one has to learn the
language, then one has to learn the libraries. The number of open source packages made available by
the Python community can increase the effort required to understand an entire architecture. The reward,
however, is high-quality software based on high-quality components, with a minimum of development and
integration effort.
Many languages offer a number of tools that can accomplish the same basic task. Python is no exception. It
is often difficult to know which of many alternatives performs better or is easier to adapt. We’ll try to focus
on showing the most helpful approach, emphasizing techniques that apply for larger development efforts.
We’ll try to avoid “quick and dirty” solutions that are only appropriate when learning the language.
1.2 Audience
Professional programmers who need to learn Python are our primary audience. We provide specific help for
you in a number of ways.
• Since Python is simple, we can address newbie programmers who don’t have deep experience in a
number of other languages. We will call out some details in specific newbie sections. Experienced
programmers can skip these sections.
• Since Python has a large number of sophisticated built-in data structures, we address these separately
and fully. An understanding of these structures can simplify complex programs.
• The object-orientation of Python provides tremendous flexibility and power. This is a deep subject,
and we will provide an introduction to object-oriented programming in this book. More advanced
design techniques are addressed in Building Skills in Object-Oriented Design, [Lott05].
• The accompanying libraries make it inexpensive to develop complex and complete solutions with min-
imal effort. This, however, requires some time to understand the packaged components that are avail-
able, and how they can be integrated to create useful software. We cover some of the most important
modules to specifically prevent programmers from reinventing the wheel with each project.
Instructors are a secondary audience. If you are looking for classroom projects that are engaging, compre-
hensible, and focus on perfecting language skills, this book can help. Each chapter in this book contains
exercises that help students master the concepts presented in the chapter.
This book assumes an basic level of skill with any of the commonly-available computer systems. The following
skills will be required.
6 Chapter 1. Preface