Learning Python, 3rd Edition

Learning Python, 3rd Edition
by Mark Lutz

Learning Python, 3rd Edition
List Price: $39.99
Our Price: $19.95
You Save: $20.04 (50%)
Availability: Usually ships in 1-2 business days
Buy Used: from $4.18 (click here)
Category: Book
See more book details and other editions


or

Book Summary Information

Author: Mark Lutz
Edition: Paperback
Audio: English (Original Language); English (Unknown); English (Published)
Published: 2007-10-22
ISBN: 0596513984
Number of pages: 752
Publisher: O'Reilly Media
Product features:

Book Reviews of Learning Python, 3rd Edition

Book Review: Great for learning the CORE language ...
Summary: 5 Stars



import my_four_recommendations:

from bookshelf import "Learning Python 4th ed. - by Lutz/O'Reilly", "Beginning Python from Novice to Professional - by Lie Hetland/Apress", "The Quick Python Book - by Ceder/Manning", "Python Programming on Win32 - by Mark Hammond"



############################
#Comparative overview
############################


I have the four books above. They all have their strengths and weaknesses, but are all of very high quality overall.
However the Lutz/O'Reilly book has more pages, and is more comprehensive, and is probably my favorite for learning the CORE LANGUAGE from straight beginner level. It can be verbose, and goes through every detail of the language, from the very basic stuff to the very high level stuff listing every sort of avenue/path you could potentially take in utilising the language, and explains it in very clear, plain and concise prose. Good examples after each instance of a new concept, and also examples of errors for illustration purposes if you were to not write the code in the right way is very helpful.

A detailed example would be the following on OPENING FILES. Here are three passages from each book explaining the same concept:

Lutz p.230-233 on "Opening Files":

###The Lutz book lists all filetype operations in a table first###

"To open a file, a program calls the built-in open function, with the external filename
first, followed by a processing mode. The mode is typically the string 'r' to open for
text input (the default), 'w' to create and open for text output, or 'a' to open for
appending text to the end. The processing mode argument can specify additional
options:
*Adding a b to the mode string allows for binary data (end-of-line translations and
3.0 Unicode encodings are turned off).
*Adding a + opens the file for both input and output (i.e., you can both read and
write to the same file object, often in conjunction with seek operations to reposition
in the file).
Both arguments to open must be Python strings, and an optional third argument can
be used to control output buffering--passing a zero means that output is unbuffered
(it is transferred to the external file immediately on a write method call). The external
filename argument may include a platform-specific and absolute or relative directory
path prefix; without a directory path, the file is assumed to exist in the current working
directory (i.e., where the script runs). We'll cover file fundamentals and explore some
basic examples here, but we won't go into all file-processing mode options; as usual,
consult the Python library manual for additional details."

#The Lutz book then shows three specific examples of opening files 'In Action'. These examples go on for about 1-2 pages after the initial opening paragraph as aforementioned above.

-------------------

Lie Hetland/Apress p. 255 on "Opening Files":

"You can open files with the open function, which has the following syntax: open(name[, mode[, buffering]])
The open function takes a file name as its only mandatory argument, and returns a file object. The mode and buffering arguments are both optional and will be explained in the material that follows.
So, assuming that you have a text file (created with your text editor, perhaps) called
somefile.txt stored in the directory C:\text (or something like ~/text in UNIX), you can
open it like this:
>>> f = open(r'C:\text\somefile.txt')
If the file doesn't exist, you may see an exception traceback like this:
Traceback (most recent call last):
File "", line 1, in ?
IOError: [Errno 2] No such file or directory: "C:\\text\\somefile.txt"
You'll see what you can do with such file objects in a little while, but first, let's take a look
at the other two arguments of the open function."

--------------------

Ceder/Manning p. 159-160 on "Opening Files":

"In Python, you open and read a file using the built-in open function and various
built-in reading operations. The following short Python program reads in one line
from a text file named myfile:
file_object = open('myfile', 'r')
line = file_object.readline()
open doesn't read anything from the file; instead it returns an object called a file
object that you can use to access the opened file. A file object keeps track of a file
and how much of the file has been read or written. All Python file I/O is done using
file objects rather than filenames.
The first call to readline returns the first line in the file object, everything up to
and including the first newline character or the entire file if there is no newline char-
acter in the file; the next call to readline would return the second line, and so on.
The first argument to the open function is a pathname. In the previous example,
we're opening what we expect to be an existing file in the current working directory.
The following opens a file at the given absolute location:
import os
file_name = os.path.join("c:", "My Documents", "test", "myfile")
file_object = open(file_name, 'r')"

###############

As you can see the Lutz/O'Reilly is alot more comprehensive when it talks about the core language, explaining in detail how the language works behind the scenes. The Lie Hetland book tries to be very brief and concise but more broad.
The Manning book is probably best for people who already know Python and are looking for a quick reference to rejog the memory, since it is condensed to the most important features, functions and concepts in Python.

I think the titles do a good job of representing each book;
"Learning Python" is meant to be for beginners learning the language thoroughly.
"Beginning Python From Novice to Professional" is good for those who want to go quickly from the Novice to Professional spectrum. Perhaps good for people with a good background in other languages.
And "The Quick Python Book" is probably for those who are well versed in other languages as well as know Python already.

################################################
#Advanced features not included in the Lutz book
################################################

The biggest drawback to the Lutz/O'Reilly book is that it doesn't include advanced modules like the 'urllib', 'csv', win32/COM and the 'xml' modules. These modules were specifically of interest to me, and I had to source that from the Lie Hetland/Apress book. (For more info on win32COM + Python, see Mark Hammond's book; "Python Programming on Win32).
The Lutz book seems more comprehensive on explaining the LANGUAGE and how to master it, whilst the Lie Hetland/Apress book does this also, but goes into the more advanced features of Python and its usefulness and power for the real world. For example there is more discussion on how best to make use of Python for your needs at an advanced level, like how to go about extending/implementing Jython, IronPython or the different GUI packages out there for use. Lutz' book has none of this in any detail.


"""
#Note:
If you're buying computer programming books, it makes more sense to buy it in digital form. As you can use the search function, as opposed to hardcopy where it's probably harder to search for specific terms and symbols that relate directly to your query/problem.

Another book you could look at that I have not used is Wesley Chun's "Core Python Programming" or Mark Summerfield's "Programming in Python 3". Summerfield's book is more recent in terms of the currency of the language, however Lutz' book reviewed here is more up to date in terms of publication.
"""

Summary of Learning Python, 3rd Edition

Portable, powerful, and a breeze to use, Python is ideal for both standalone programs and scripting applications. With this hands-on book, you can master the fundamentals of the core Python language quickly and efficiently, whether you're new to programming or just new to Python. Once you finish, you will know enough about the language to use it in any application domain you choose. Learning Python is based on material from author Mark Lutz's popular training courses, which he's taught over the past decade. Each chapter is a self-contained lesson that helps you thoroughly understand a key component of Python before you continue. Along with plenty of annotated examples, illustrations, and chapter summaries, every chapter also contains Brain Builder, a unique section with practical exercises and review quizzes that let you practice new skills and test your understanding as you go. This book covers: Types and Operations -- Python's major built-in object types in depth: numbers, lists, dictionaries, and more Statements and Syntax -- the code you type to create and process objects in Python, along with Python's general syntax model Functions -- Python's basic procedural tool for structuring and reusing code Modules -- packages of statements, functions, and other tools organized into larger components Classes and OOP -- Python's optional object-oriented programming tool for structuring code for customization and reuse Exceptions and Tools -- exception handling model and statements, plus a look at development tools for writing larger programs. Learning Python gives you a deep and complete understanding of the language that will help you comprehend any application-level examples of Python that you later encounter. If you're ready to discover what Google and YouTube see in Python, this book is the best way to get started.
The authors of Learning Python show you enough essentials of the Python scripting language to enable you to begin solving problems right away, then reveal more powerful aspects of the language one at a time. This approach is sure to appeal to programmers and system administrators who have urgent problems and a preference for learning by semi-guided experimentation.

First off, Learning Python shows the relationships among Python scripts and their interpreter (in a mostly platform-neutral way). Then, the authors address the mechanics of the language itself, providing illustrations of how Python conceives of numbers, strings, and other objects as well as the operators you use to work with them. Dictionaries, lists, tuples, and other data structures specific to Python receive plenty of attention including complete examples.

Authors Mark Lutz and David Ascher build on that fundamental information in their discussions of functions and modules, which evolve into coverage of namespaces, classes, and the object-oriented aspects of Python programming. There's also information on creating graphical user interfaces (GUIs) for Python applications with Tkinter.

In addition to its careful expository prose, Learning Python includes exercises that both test your Python skills and help reveal more elusive truths about the language.

General Books

Book Subjects
Most talked about in General Books
Programming Coldfusion ImageProgramming Coldfusion
by Rob Brooks-Bilson
O'Reilly Media; Published: 2001-08-06; Paperback; Book
Best price: $7.75
Price in other shops: $49.95
C++ the Core Language (Nutshell Handbooks) ImageC++ the Core Language (Nutshell Handbooks)
by Doug Brown, Gregory Satir
O'Reilly Media; Published: 1995-10-19; Paperback; Book
Best price: $33.00
The Ruby Programming Language ImageThe Ruby Programming Language
by David Flanagan, Yukihiro Matsumoto
O'Reilly Media; Published: 2008-01-25; Paperback; Book
Best price: $21.48
Price in other shops: $39.99
The Twitter Book ImageThe Twitter Book
by Tim O'Reilly, Sarah Milstein
O'Reilly Media; Published: 2009-05-13; Paperback; Book
Best price: $10.79
Price in other shops: $19.99
FrontPage 2003 (The Missing Manual) ImageFrontPage 2003 (The Missing Manual)
by Jessica Mantaro
O'Reilly Media; Published: 2005-08-18; Paperback; Book
Best price: $14.99
Price in other shops: $29.95
Time Management for System Administrators ImageTime Management for System Administrators
by Thomas A. Limoncelli
O'Reilly Media; Published: 2005-11-22; Paperback; Book
Best price: $14.99
Price in other shops: $24.95
C# 3.0 in a Nutshell: A Desktop Quick Reference (In a Nutshell (O'Reilly)) ImageC# 3.0 in a Nutshell: A Desktop Quick Reference (In a Nutshell (O'Reilly))
by Joseph Albahari, Ben Albahari
O'Reilly Media; Published: 2007-09-26; Paperback; Book
Best price: $28.98
Price in other shops: $49.99
PC Annoyances: How to Fix the Most Annoying Things about Your Personal Computer ImagePC Annoyances: How to Fix the Most Annoying Things about Your Personal Computer
by Steve Bass
O'Reilly Media; Published: 2003-10-14; Paperback; Book
Best price: $0.58
Price in other shops: $19.95
Programming .NET Components ImageProgramming .NET Components
by Juval Lowy
O'Reilly Media; Published: 2003-04; Paperback; Book
Best price: $2.86
Price in other shops: $39.95
ActionScript : The Definitive Guide ImageActionScript : The Definitive Guide
by Colin Moock
O'Reilly Media; Published: 2001-05; Paperback; Book
Best price: $2.99
Price in other shops: $39.95
Similar Books and other products
Gray Hat Python: Python Programming for Hackers and Reverse Engineers ImageGray Hat Python: Python Programming for Hackers and Reverse Engineers
by Justin Seitz
No Starch Press; Published: 2009-04-20; Paperback; Book
Best price: $24.30
Price in other shops: $39.95
Beginning Python: From Novice to Professional, Second Edition ImageBeginning Python: From Novice to Professional, Second Edition
by Magnus Lie Hetland
Apress; Published: 2008-09-08; Paperback; Book
Best price: $28.21
Price in other shops: $44.99
Learning Perl, 5th Edition ImageLearning Perl, 5th Edition
by Randal Schwartz, Tom Phoenix, brian d foy
O'Reilly Media; Published: 2008-06-27; Paperback; Book
Best price: $23.99
Price in other shops: $39.99
Natural Language Processing with Python ImageNatural Language Processing with Python
by Steven Bird, Ewan Klein, Edward Loper
O'Reilly Media; Published: 2009-06-19; Paperback; Book
Best price: $34.32
Price in other shops: $44.99
Python Programming for the Absolute Beginner, 3rd Edition ImagePython Programming for the Absolute Beginner, 3rd Edition
by Michael Dawson
Course Technology PTR; Published: 2010-01-01; Paperback; Book
Best price: $19.99
Price in other shops: $34.99
Python in a Nutshell, Second Edition (In a Nutshell (O'Reilly)) ImagePython in a Nutshell, Second Edition (In a Nutshell (O'Reilly))
by Alex Martelli
O'Reilly Media; Published: 2006-07-14; Paperback; Book
Best price: $11.69
Price in other shops: $39.99
Python Essential Reference (4th Edition) ImagePython Essential Reference (4th Edition)
by David M. Beazley
Addison-Wesley Professional; Published: 2009-07-19; Paperback; Book
Best price: $25.66
Price in other shops: $44.99
Python Pocket Reference: Python in Your Pocket (Pocket Reference (O'Reilly)) ImagePython Pocket Reference: Python in Your Pocket (Pocket Reference (O'Reilly))
by Mark Lutz
O'Reilly Media; Published: 2009-10-08; Paperback; Book
Best price: $8.84
Price in other shops: $14.99
Python Cookbook ImagePython Cookbook
by Alex Martelli, Anna Ravenscroft, David Ascher
O'Reilly Media; Published: 2005-03-18; Paperback; Book
Best price: $29.99
Price in other shops: $49.95
Programming Python ImageProgramming Python
by Mark Lutz
O'Reilly Media; Published: 2006-08-23; Paperback; Book
Best price: $33.78
Price in other shops: $59.99