Preface

 

 

 

 

About this class

 

 

This class introduces students to the Python programming language, and common Python applications.  Through lectures and hands-on laboratory work, students learn the basics of Python programming.  We’ll cover the Python language, study C/C++ integration topics, and introduce common Python application domains such as GUIs, databases, web sites, and system tools.

 

This class presents Python in a bottom-up fashion – we start with small details and build to larger and larger examples as we move along.  This class is also designed to provide an in-depth look at Python itself, and a general and broad survey of Python applications – although we will study some advanced Python application domains, we won’t have time to do full justice to most.  Specialized domains (e.g., Tkinter GUIs, numeric programming, Internet scripting) can be more thoroughly covered in follow-up books and classes. 

 

There are no real prerequisites for most of this course, though the last two modules on C integration will be more meaningful if you have basic C programming skills.  Any prior programming or scripting experience applies, no matter how minor.  For more details about this course, see my training webpage (http://home.earthlink.net/~python-training).

 

 

 

 

About the program examples

 

 

The examples in this course are based on Python versions 2.5 and later (at this writing).  We will look at some cutting edge new features of Python along the way; but since later releases are generally backward compatible with earlier ones, most of the material here should apply earlier Python releases as well.

 

Source code for all the lecture examples and laboratory exercises is available on this CD.  You may also cut and paste code from these web pages, and at the end of unit web pages you will find links to source-code file directories on this CD-ROM for exercise solutions and lecture examples.  In fact, if you are using this HTML form of the workbook, you don’t need the hardcopy paper workbook at all; it’s all in this package. Simply follow the links in the table of contents page.

 

 

 

 

Suggested supplemental books

 

 

Because this class workbook is a self-contained document, there are no additional required texts for this class. However, students may wish to obtain related books to serve as supplemental resources. Here are some suggestions:

 

Directly related books

The core language sections of this class parallel the book Learning Python 2nd Edition, and the more advanced applications-level material in this class parallel the book Programming Python 3rd Edition, both published by O’Reilly & Associates. The first of these two cover language fundamentals and is largely based upon the main portion of this class; it may be available in a 3rd Edition by late 2007.  The latter book is an advanced continuation of the former, and is focused on applications-level programming topics.

 

Some clients may wish to provide students with copies of either or both of these texts for use after the class, depending upon student interest and skill levels.  If you need to obtain copies of these books, they can be purchased from most large or technical bookstores, directly from O’Reilly (see URL http://www.oreilly.com/), or through the Python web site (http://www.python.org/) or amazon.com.

 

Recommended books

Though not required for this class, O’Reilly’s Python Pocket Reference 3rd Edition is also suggested as a reference supplement that will prove handy after the class.  I also recommend the text Python Essential Reference 3rd Edition by David Beazley, as well as Python in a Nutshell 2nd Edition and Python Cookbook 2nd Edition from O’Reilly, as supplemental reference books. In addition, there are now some 50 Python books on the market that may be of interest as well, depending upon your Python applications; see the (slightly dates) books list in the Packages and Resources lecture page for a list.

 

 

 

 

About the instructor

Mark Lutz is the world leader in Python training, the author of Python's earliest and best-selling texts, and a pioneering figure in the Python community.

Mark is the author of the O'Reilly books Programming Python and Python Pocket Reference, and the primary co-author of Learning Python, all currently in 2nd or 3rd Editions. He has been using and promoting Python since 1992, began teaching Python classes in 1997, and has instructed some 200 Python training sessions as of early 2007.

In addition, he holds BS and MS degrees in computer science from the University of Wisconsin, and over the last two decades has worked on compilers, programming tools, scripting applications, and assorted client/server systems.

Whenever Mark gets a break from spreading the Python word, he leads an ordinary, average life in Colorado. Mark can be reached by email at lutz@rmi.net, or on the web at http://www.rmi.net/~lutz and http://home.earthlink.net/~python-training.

 

 

 

Daily schedule

 

Each class proceeds at a slightly different rate, and our schedule is going to vary each day.  Typically, there will four to six lectures sessions per day, with laboratory work time after each, and an hour for lunch.  The exact session schedule depends on student needs and interests, and on how much interaction students desire; questions and comments at any time are encouraged.

 

Also note that we never cover all the material in this workbook in a 3-day class.  In general, the workbook contains a superset of topics to be presented, and some of its examples are included for student self-study only.  Material skipped is either of minor importance, or optional reading.  We may also sometimes depart from the workbook to explore special topics of interest to students.  This is your class – please ask about topics not listed above.

 

 

 

 

Course topics

 

 

 

Introducing Python

General Python introduction

 

Python Basics

Using the interpreter

Types and operators

Basic statements

Functions

Modules

Classes

Exceptions

Built-in tools

 

Python Applications

System interfaces

GUI programming

Databases and persistence

Text processing

Internet scripting

Extending Python in C/C++

Embedding Python in C/C++

 

Where to go from here?

Python resources