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

Description

  • 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
Acknowledgments.

Introduction.

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.

Glossary.

Index.

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.
Download
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.
Download
ChapterPageDetailsDatePrint Run
6Typo
python

should be:
Python
07/01/07

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:

0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,10,11,12,13,14

and not:

0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,10,11,12,13
06/26/2006

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

Should read:
>>> print a[len(a) - 1]
third
8/24/05

445Error in Code
">>> tuesday_breakfast_sold != thursday_breakfast_sold False"

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

OR
the "!=" should be "==" and then the "False" is correct.
10/4/11

61Error in Code/Text
Page 61, first printing:

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

The snippet following, "def in_fridge:" should be part of the code example below it.
09/08/2006

315, 317, 321Error in Code
... = MIMEImage(open(filename).read(), ...

Should be:
... = MIMEImage(file(filename, "rb").read() ...
09/18/07