Join Amazon Prime and ship Two-Day for free and Overnight for $3.99. Already a member? Sign in.

 

or
Sign in to turn on 1-Click ordering.
 
 
More Buying Choices
57 used & new from $16.99

Have one to sell? Sell yours here
 
   
Python in a Nutshell, Second Edition (In a Nutshell (O'Reilly))
 
 
Tell the Publisher!
I’d like to read this book on Kindle

Don’t have a Kindle? Get yours here.
 
  

Python in a Nutshell, Second Edition (In a Nutshell (O'Reilly)) (Paperback)

by Alex Martelli (Author)
Key Phrases: filesystem operations, module loading, control flow statements, Returns True, Structured Text, Extending Python (more...)
4.5 out of 5 stars See all reviews (40 customer reviews)

List Price: $39.99
Price: $26.39 & this item ships for FREE with Super Saver Shipping. Details
You Save: $13.60 (34%)
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.

Want it delivered Tuesday, July 14? Choose One-Day Shipping at checkout. Details
36 new from $21.55 21 used from $16.99
Also Available in: List Price: Our Price: Other Offers:
Paperback (1st) 18 used & new from $5.27
Like this book? Find similar titles from O'Reilly and Partners in our O'Reilly Bookstore.

Best Value

Buy Python for Unix and Linux System Administration and get Python in a Nutshell, Second Edition (In a Nutshell (O'Reilly)) at an additional 5% off Amazon.com's everyday low price.

Python for Unix and Linux System Administration + Python in a Nutshell, Second Edition (In a Nutshell (O'Reilly))
Buy Together Today: $56.56

Show availability and shipping details

  • Python for Unix and Linux System Administration

    In Stock.
    Ships from and sold by Amazon.com.
    This item ships for FREE with Super Saver Shipping. Details

  • This item: Python in a Nutshell, Second Edition (In a Nutshell (O'Reilly))

    In Stock.
    Ships from and sold by Amazon.com.
    This item ships for FREE with Super Saver Shipping. Details


Customers Who Bought This Item Also Bought

Learning Python, 3rd Edition

Learning Python, 3rd Edition

by Mark Lutz
3.9 out of 5 stars (137)  $26.39
Python Cookbook

Python Cookbook

by Alex Martelli
4.3 out of 5 stars (42)  $32.97
Programming Python

Programming Python

by Mark Lutz
4.0 out of 5 stars (7)  $37.79
Python Pocket Reference (Pocket Reference (O'Reilly))

Python Pocket Reference (Pocket Reference (O'Reilly))

by Mark Lutz
3.8 out of 5 stars (14)  $9.95
Python Essential Reference (4th Edition) (Developer's Library)

Python Essential Reference (4th Edition) (Developer's Library)

by David M. Beazley
4.6 out of 5 stars (70)  $29.69
Explore similar items

Editorial Reviews

Review
"Brave beginners will be well served by this title, which provides an intelligent, fast paced intro to core topics." - Martin Howse, LinuxUser & Developer, Issue 30 "I whole-heartedly recommend this book to all Python programmers. It is a very concise and informative book, and its small size belies its information content. I would also recommend and suggest this book to any experienced programmers wishing to begin programming in Python, who would enjoy a straight-to-the-point manual on the Python language." - Daire Stockdale, Cvu/ACCU --This text refers to the Paperback edition.

Product Description
This book offers Python programmers one place to look when they need help remembering or deciphering the syntax of this open source language and its many powerful but scantily documented modules. This comprehensive reference guide makes it easy to look up the most frequently needed information--not just about the Python language itself, but also the most frequently used parts of the standard library and the most important third-party extensions.

Ask any Python aficionado and you'll hear that Python programmers have it all: an elegant object-oriented language with readable and maintainable syntax, that allows for easy integration with components in C, C++, Java, or C#, and an enormous collection of precoded standard library and third-party extension modules. Moreover, Python is easy to learn, yet powerful enough to take on the most ambitious programming challenges. But what Python programmers used to lack is a concise and clear reference resource, with the appropriate measure of guidance in how best to use Python's great power. "Python in a Nutshell" fills this need.

"Python in a Nutshell," Second Edition covers more than the language itself; it also deals with the most frequently used parts of the standard library, and the most popular and important third party extensions. Revised and expanded for Python 2.5, this book now contains the gory details of Python's new subprocess module and breaking news about Microsoft's new IronPython project. Our "Nutshell" format fits Python perfectly by presenting the highlights of the most important modules and functions in its standard library, which cover over 90% of your practical programming needs. This book includes: A fast-pacedtutorial on the syntax of the Python language An explanation of object-oriented programming in Python Coverage of iterators, generators, exceptions, modules, packages, strings, and regular expressions A quick reference for Python's built-in types and functions and key modules Reference material on important third-party extensions, such as Numeric and Tkinter Information about extending and embedding Python

"Python in a Nutshell" provides a solid, no-nonsense quick reference to information that programmers rely on the most. This book will immediately earn its place in any Python programmer's library. Praise for the First Edition:

"In a nutshell, "Python in a Nutshell" serves one primary goal: to act as an immediately accessible goal for the Python language. True, you can get most of the same core information that is presented within the covers of this volume online, but this will invariably be broken into multiple files, and in all likelihood lacking the examples or the exact syntax description necessary to truly understand a command."
--Richard Cobbett, "Linux Format"

"O'Reilly has several good books, of which "Python in a Nutshell" by Alex Martelli is probably the best for giving you some idea of what Python is about and how to do useful things with it."
--Jerry Pournelle, "Byte Magazine"

See all Editorial Reviews


Product Details

  • Paperback: 734 pages
  • Publisher: O'Reilly Media, Inc.; 2 edition (July 14, 2006)
  • Language: English
  • ISBN-10: 0596100469
  • ISBN-13: 978-0596100469
  • Product Dimensions: 8.8 x 6.1 x 1.7 inches
  • Shipping Weight: 1.8 pounds (View shipping rates and policies)
  • Average Customer Review: 4.5 out of 5 stars See all reviews (40 customer reviews)
  • Amazon.com Sales Rank: #14,185 in Books (See Bestsellers in Books)

    Popular in these categories: (What's this?)

    #9 in  Books > Computers & Internet > Programming > Languages & Tools > Python
    #38 in  Books > Computers & Internet > Programming > Software Design, Testing & Engineering > Object-Oriented Design

Inside This Book (learn more)


What Do Customers Ultimately Buy After Viewing This Item?

Python in a Nutshell, Second Edition (In a Nutshell (O'Reilly))
65% buy the item featured on this page:
Python in a Nutshell, Second Edition (In a Nutshell (O'Reilly)) 4.5 out of 5 stars (40)
$26.39
Learning Python, 3rd Edition
20% buy
Learning Python, 3rd Edition 3.9 out of 5 stars (137)
$26.39
Python Programming for the Absolute Beginner
5% buy
Python Programming for the Absolute Beginner 4.3 out of 5 stars (43)
$19.79
Programming Python
5% buy
Programming Python 4.0 out of 5 stars (7)
$37.79

Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
Check the boxes next to the tags you consider relevant or enter your own tags in the field below.
(25)
(2)
(1)

Your tags: Add your first tag
 
Help others find this product — tag it for Amazon search
No one has tagged this product for Amazon search yet. Why not be the first to suggest a search for which it should appear?

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

 

Customer Reviews

40 Reviews
5 star:
 (28)
4 star:
 (7)
3 star:
 (4)
2 star:
 (1)
1 star:    (0)
 
 
 
 
 
Average Customer Review
4.5 out of 5 stars (40 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

 
74 of 74 people found the following review helpful:
4.0 out of 5 stars Nutshell v. Online Docs (2nd edition too), March 8, 2004
This review is from: Python in a Nutshell (Paperback)
This is a great book, without question. The question is whether it is worth the price, given the free online HTML reference documentation.

Pros:
+ Very good index; somewhat better than the online index.
+ Helpful explanations.
+ Some examples.
+ Much more advice than the online docs.
+ Very nice typesetting.

Cons (1st edition):
- Does not cover some of the most useful (new) modules: timeit, logging, zipimport, itertools, sets, sum, heapq.
- In particular, I would love to have ADVICE on how to use logging effectively.
- DOES cover the dead (insecure) modules rexec and Bastion.

So take your own decision. Personally, I would say it's not essential, but still worth the price. I go back and forth between the online index and this book.

Addendum:

The 2nd edition covers most of Python2.5. (The 1st covered 2.2 and much of 2.3). It includes most useful modules and excludes the deprecated ones, so it actually adds much more info than its slight increase in page-count would indicate. The only thing I was not able to find was 'meta_path', which is at least mentioned as highly technical.

In general, the 2nd edition is for a more expert user than the 1st. The explanations sometimes include some dense code:

* There is a long example of using meta-classes.
* The explanation of the new try/except/finally assumes that you understand the old (broken) behavior.
* The 'with' statement is explained by way of an equivalent fragment of code.

These changes make the 2nd edition ideal for the practicing Python programmer. However, a novice might be intimidated.

I would now increase the rating to 5 stars if I could. Excellent reference work!
Comment Comment (1) | Permalink | Was this review helpful to you? Yes No (Report this)



 
50 of 53 people found the following review helpful:
5.0 out of 5 stars A Classic Book, April 16, 2003
By Ronald D. Stephens "Book Worm" (Newtown, CT United States) - See all my reviews
(REAL NAME)   
This review is from: Python in a Nutshell (Paperback)
Python in a Nutshell, by Alex Martelli, 2003 O'Reilly, 636 pages.

Perhaps the best book about Python ever written, this book is the perfect capstone to anyone's library of Pythonic books, and also the perfect introduction to Python for anyone well versed in other programming languages. For newbies to programming, this would still be a good second book after a good introductory book on Python, such as Learning Python by Mark Lutz.

Written by my favorite author and Pythonista, Alex Martelli, this book manages to fill three roles in extremely pleasing fashion. First and foremost to me, it is a great read, straight through. Mr. Martelli's prose is always sparkling and always keeps the reader interested. No matter how many Python books you have read, you will learn some nuances from this book, and it is about the best review of the whole Pythonic subject matter that I can imagine. While there is absolutely no fluff whatsoever in these 636 pages, it still makes for rather easy reading because the explanations are so clearly thought out and explored as to lead one gently to understanding, without in any way being verbose. It is obvious that Alex Martelli took his time and put in sufficient thought, effort, and intellectual elbow-grease to make this work a classic for all time.

Secondly, this book is the ultimate Pythonic reference book, the best fit to this role I have yet seen. You will keep this book in the most cherished spot on your book shelf, or else right at your side on your computer desk, because you can almost instantly find any topic on which you need to brush up, in the midst of a programminng project.

Third, Python in a Nutshell is the most up-to-date book on Python (as of April 2003) and includes the best and most complete expositions yet on the new features introduced in Python 2.2 and 2.3. These topics are not only covered in depth, they are integrated into the text in their proper positions and relationships to the language as a whole. They are explained better here than I have seen anywhere else, so much so as to make them not only understandable to me (a duffer), but indeed so that they appear seamlessly Pythonic, as if they had been a part of the language since version 1.0. Topics explored in depth include new style classes, static methods, class methods, nested scopes, iterators, generators, and new style division. List comprehensions are made not only comprehesible but indeed intuitive.

The book is surprisingly complete. It covers the core language as well as the most popular libraries and extension modules. It is difficult to choose any one portion of the book to highlight for extra praise, as all topics are treated so well. It is a complete book, the new definitive book about Python.

Everything about this book speaks of quality. In addition to the top notch writing and editing, O'Reilly really did the right thing and published this book printed on the highest quality paper, paper so thin that the 636 pages are encompassed in a book much thinner than one would expect for such a size, but strong enough to resist wear and tear. The text is most pleasing to the eye. Holding the book, and turning its pages, gives one a feeling of satisfaction.

Any job worth doing is worth doing well. Alex Martelli and O'Reilly have done justice to a topic dear to our hearts, the Python programming language. Perhaps, in years to come, the passing time may make this book be no longer the most up-to-date reference on the newest features added to Python. But time can not erase the quality craftsmanship and the shear joy of reading such a well thought out masterpiece of Pythonic literature.

Ron Stephens

Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
19 of 20 people found the following review helpful:
5.0 out of 5 stars This book can even teach developers of the language!, May 1, 2003
By Brett Cannon "incessantranting" (San Luis Obispo, CA USA) - See all my reviews
(REAL NAME)   
This review is from: Python in a Nutshell (Paperback)
I bought this book at the PyCon 2003 Python conference mainly to complete my Python book collection. I thought that since it was a Nutshell book and I already knew a ton about Python (I am an official developer on the language) that I wouldn't really pick up that much.

I was wrong. Not only did I learn some new things, but Alex's wonderful way of presenting ideas helped clarify and present a different view of some vital concepts in Python that made them even easier to grasp than I had originally thought. There is a reason why he is called the Martellibot on comp.lang.python and the python-dev mailing list.

I also have a friend who is a programmer who has read the first chapter or so of the book and has also found it a great way to learn Python.

So whether you are a hardened Python programmer or just starting out (as long as you can already program), this book is definitely worth the money. And the Python Cookbook makes a great companion book to this to pick up a few tricks and get even more example code to learn from (especially from my contributed recipes to the book =).

Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)


Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews

5.0 out of 5 stars Excellent reference book for Python. Not for learning, but great reference.
This book is strictly a reference book. It contains snippets of examples and detailed explanations about each Python function/features. It is very, very good for that. Read more
Published 3 months ago by David Alan Tussey

3.0 out of 5 stars Not a Nutshell
On the downside, there was a few chapters to read through before I actually started programming. On the upside, I really enjoyed reading it. Read more
Published 4 months ago by Laura Bickle

3.0 out of 5 stars Just Good Enough
Just good enough, I do not recommend it. In case that you really want to profit your time go directly to the "Python Cookbook" from O'Reilly.
Published 4 months ago by Marc Magrans De Abril

4.0 out of 5 stars In a Nutshell is correct.
A great reference book, but alone it wouldn't be my way to learn the language; it's a bit terse for that. Read more
Published 5 months ago by David A. Schultz

4.0 out of 5 stars Great book - a little lenghty for a nutshell
I keep coming back to this book, either to clarify what other books needlessly complicate or simply don't include. Read more
Published 16 months ago by RF RDC

5.0 out of 5 stars A must-have
The documentation that comes with Python leaves a lot to be desired. Try understanding and using internationalisation, for example. Read more
Published 16 months ago by M. Henri De Feraudy

5.0 out of 5 stars A Python Developer's Third Arm
'Python In A Nutshell' is one of those de facto standard O'Reilly books that is required reading/owning for anyone that develops in said language. Read more
Published 17 months ago by Daniel McKinnon

5.0 out of 5 stars Best reference for Python
This is simply the best reference book for Python.

As a reference book it not suitable for learning Python from scratch, even if there is a not-so-short introduction... Read more
Published 18 months ago by Alessandro Ferretti

5.0 out of 5 stars Python in a Nutshell 2nd Edition

The author Alex Martelli is Uber Technical Lead at Google, Inc. Martelli holds a laurea in Ingegneria Elettronica from Bologna University. Read more
Published 18 months ago by Max Slimmer

5.0 out of 5 stars Simply the best generalist reference for the medium/advanced Python programmer
Nutshell is rather dry reading and provides very little of the usual user-friendly introductions to language features by solving simple problems. Read more
Published 19 months ago by WiltDurkey

Only search this product's reviews



Customer Discussions

 Beta (What's this?)
New! See all customer communities, and bookmark your communities to keep track of them.
This product's forum (0 discussions)
  Discussion Replies Latest Post
  No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
  [Cancel]


Active discussions in related forums
  Discussion Replies Latest Post
C# or Java? 32 5 days ago
   


Product Information from the Amapedia Community

Beta (What's this?)

Listmania!

Create a Listmania! list

So You'd Like to...

Create a guide

Look for Similar Items by Category


Hot Deals on Hitachi

Hitachi power tools
Routers don't get much more powerful than the "Incredible Hulk." Check out the entire line of Hitachi routers sold by Amazon.com.

Shop all Hitachi

 

Best Books of 2008

Best of 2008
Find our top 100 editors' picks as well as customers' favorites in dozens of categories in our Best Books of 2008 Store.
 

Buy Three Books, Get a Fourth Free

4-for-3 Books
Order any four eligible books under $10 and get the lowest-price book free in our 4-for-3 Books Store. See more details.
 

No X-Ray Vision Needed

Shop for stud finders
Explore our wide variety of stud finders and scanners in the Home Improvement Store.

Shop for stud finders

 

 

Feedback

If you need help or have a question for Customer Service, contact us.
 Would you like to update product info or give feedback on images?
Is there any other feedback you would like to provide?

Your comments can help make our site better for everyone.


Where's My Stuff?

Shipping & Returns

Need Help?

Your Recent History

  (What's this?)
You have no recently viewed items or searches.

After viewing product detail pages or search results, look here to find an easy way to navigate back to pages you are interested in.

Look to the right column to find helpful suggestions for your shopping session.

Continue shopping: Top Sellers

Conditions of Use | Privacy Notice © 1996-2009, Amazon.com, Inc. or its affiliates