Skip to main content

Beginning Python

Beginning Python

Peter C. Norton, Alex Samuel, Dave Aitel, Eric Foster-Johnson, Leonard Richardson, Jason Diamond, Aleatha Parker, Michael Roberts

ISBN: 978-0-471-76031-3

Jul 2005

649 pages

Select type: E-Book

Product not available for purchase


  • This tutorial offers readers a thorough introduction to programming in Python 2.4, the portable, interpreted, object-oriented programming language that combines power with clear syntax
  • Beginning programmers will quickly learn to develop robust, reliable, and reusable Python applications for Web development, scientific applications, and system tasks for users or administrators
  • Discusses the basics of installing Python as well as the new features of Python release 2.4, which make it easier for users to create scientific and Web applications
  • Features examples of various operating systems throughout the book, including Linux, Mac OS X/BSD, and Windows XP


Chapter 1: Programming Basics and Strings.

Chapter 2: Numbers and Operators.

Chapter 3: Variables—Names for Values.

Chapter 4: Making Decisions.

Chapter 5: Functions.

Chapter 6: Classes and Objects.

Chapter 7: Organizing Programs.

Chapter 8: Files and Directories.

Chapter 9: Other Features of the Language.

Chapter 10: Building a Module.

Chapter 11: Text Processing.

Chapter 12: Testing.

Chapter 13: Writing a GUI with Python.

Chapter 14: Accessing Databases.

Chapter 15: Using Python for XML.

Chapter 16: Network Programming.

Chapter 17: Extension Programming with C.

Chapter 18: Writing Shareware and Commercial Programs.

Chapter 19: Numerical Programming.

Chapter 20: Python in the Enterprise.

Chapter 21: Web Applications and Web Services.

Chapter 22: Integrating Java with Python.

Appendix A: Answers to Exercises.

Appendix B: Online Resources.

Appendix C: What’s New in Python 2.4.



Source code from the book
Here is the source code from the book. The source code is stored in a .zip archive. You will need software capable of uncompressing .zip archives to view the source code.
ChapterPageDetailsDatePrint Run

should be:
24Error in Code/Text,The errata should be as follows:

Therefore, the numbers 0 to 20 in decimal....
if you add the number 14 in the sequence then this sentence will be true. So the number sequence for 0 to 20 in hex should be the following:


and not:

31Error in Code,Highlighted code, middle of page:
>>> print a[len(a) - 1]

Should read:
>>> print a[len(a) - 1]
445Error in Code, >>> tuesday_breakfast_sold != thursday_breakfast_sold False

two options for correction:
False should be True because the strings are different.

the != should be == and then the False is correct.
61Error in Code/Text,Page 61, first printing:

At the bottom, in Try It Out , the text sentence should end .

The snippet following, def in_fridge: should be part of the code example below it.
315, 317, 321Error in Code,... = MIMEImage(open(filename).read(), ...

Should be:
... = MIMEImage(file(filename, rb ).read() ...