Jump to ratings and reviews
Rate this book

In a Nutshell

Python in a Nutshell: A Desktop Quick Reference

Rate this book
Useful in many roles, from design and prototyping to testing, deployment, and maintenance, Python is consistently ranked among today's most popular programming languages. The third edition of this practical book provides a quick reference to the language--including Python 3.5, 2.7, and highlights of 3.6--commonly used areas of its vast standard library, and some of the most useful third-party modules and packages.

Ideal for programmers with some Python experience, and those coming to Python from other programming languages, this book covers a wide range of application areas, including web and network programming, XML handling, database interactions, and high-speed numeric computing. Discover how Python provides a unique mix of elegance, simplicity, practicality, and sheer power.

This edition covers:


Python syntax, Object-Oriented Python, standard library modules, and third-party Python packages
Python's support for file and text operations, persistence and databases, concurrent execution, and numeric computations
Networking basics, event-driven programming, and client-side network protocol modules
Python extension modules, and tools for packaging and distributing extensions, modules, and applications

772 pages, ebook

First published March 1, 2003

87 people are currently reading
404 people want to read

About the author

Alex Martelli

11 books1 follower

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
110 (29%)
4 stars
146 (38%)
3 stars
95 (25%)
2 stars
19 (5%)
1 star
6 (1%)
Displaying 1 - 21 of 21 reviews
Profile Image for Peter Sichevsky.
20 reviews7 followers
November 2, 2019
A must to read for any SOFTWARE developer! It simply will chnage the way you think about programming, making you write much faster, scalable, and better applications than ever.
Profile Image for Matija.
93 reviews24 followers
September 9, 2012
I admit that I had tried to learn Python by reading this book, while it seems that this is not its intended purpose. Still, even though it classifies itself as an exhaustive reference for seasoned Pythonistas, this tome starts by covering all the basics of the language like its history, most commonly used implementations and a praise for its community and a great sense of humor it possesses - information which is hardly useful for the above-mentioned audience. Despite advertised humorousness, Python in a Nutshell is a very dryly written book which piles a lot of facts in what I cannot see as anything but random order. I tried reading it twice and couldn't get myself past the first 100 pages or so - this rarely happens to me with programming books. Actually, it has happened only once. I wouldn't recommend spending any money or time on this book to anyone.
3 reviews
July 25, 2019
The author is no doubt very knowledgeable about Python, however lacks basic pedagogy, like most technical writers nowadays: there are too many forward references. Such writers must reorganize their thought process, and start by abandoning depth-first approach.
388 reviews4 followers
October 16, 2024
Well written book for programmers with some experience.

If you come from another programming language, it helps map Python concepts to the equivalents you know; if you've been coding in Python for a while, you can still learn something new (I certainly did).

The chapters can be read sequentially but at 700 pages this is already a substantial "nutshell" so you'd probably revisit individual chapters after you have some idea of what you're trying to solve and before you have a very specific idea on the solution. The documentation about specific areas and modules is reasonably succint and links suitable online references for more details (including an English Wikipedia article I helped write!).

I appreciate the comparisons between Python 2 and 3, which help understand the reasoning behind past and recent choices, which is useful to migrate legacy code.
8 reviews
September 23, 2017
Good intro and reference to Python 2.x. This is a good starter book. I recommend it.

That version is still available. However, 3.x is more up to date and the syntax has changed slightly and there are new libraries (e.g. machine learning) that only work with 3.x.

Syntax change example:
print "Hello World this is version 2.2"
print ("Hello World this is version 3.x")

I keep the book around because I marked it up and put bookmark tabs to jump to key pages with more complex functions. The examples are good---- in v 2.2 of course.
Profile Image for Lari Thurso.
4 reviews
March 8, 2019
This is a reliable companion to the Python documentation. It gives a rich view of the language and many of its most useful modules, whilst still being concise. The layout is clear and the examples of code are useful. As a coder, you might want to "keep this under your pillow" alongside the Python library reference documentation. However, it's probably not the best place for beginners to start, and it can be easier to find guidance online, e.g. through Stack Exchange.
Profile Image for Nickolai.
889 reviews8 followers
August 1, 2022
Неоднородная книга. некоторые главы написаны замечательно, содержат много подробностей и тонких моментов использования языка программирования. Другие же просто перечисляют имеющиеся возможности конкретных модулей с кратким указанием их наиболее распространенных методов.
4 reviews
August 18, 2022
It is another excellently executed O’Reilly book. I’ve not read literally every page, because it’s more of a reference than a regular book-book. I bought the Kindle edition so I could search for whatever I wanted more easily, and it made my Kindle worth every penny I paid for it.
Profile Image for Zhuzi_20.
27 reviews3 followers
July 12, 2023
It's a very dull book, and I'm against it.
Profile Image for Louis.
226 reviews30 followers
November 11, 2007
In this Alex Martelli covers the Python language and the standard library. Now, in most books of this type, the typical comment is "all the information is on the web." Well, in this case, no. For each section, Martelli opens with a brief essay explaining the purpose of the module and an explaination of what problem the module was trying to solve. And these essays are a great introduction to some of the details of computer science and programming (yes, two topics). There are some things that I never understood until I came across them in this book while trying to solve a coding problem. Using this book I wrote my way out of some problems in a way that I would have viewed as magic only a few months ago.

Very little fluff, and a lot of well written prose and code. Well recommended reference and the reading gives great insights.
Profile Image for Rakesh.
8 reviews
November 24, 2012
An encyclopedic book on Python that deals with many practical Python applications in addition to the ins and outs of the core language itself. To me, it is one of the most 'beautiful' Python books out there in terms of content and presentation. The book is well-suited for beginners as well as for those with some familiarity with the language; experienced programmers may find the text a bit verbose. The "Networking and Web Programming" section is concise yet informative. On the whole, this is a must-read book for anyone who wants to learn Python from scratch.
Profile Image for Jared.
578 reviews42 followers
Read
December 2, 2013
The content is quite good, but I don't learn well the way he presents material -- it's rather heavy on the theory, with very little in the way of example. Of course, it's meant to be "in a nutshell," so it shouldn't be long-winded. Nevertheless, I would expect a book about a programming language "in a nutshell" to be heavy on application and the features that are commonly used rather than cover every language feature, regardless of how useful it is.
10 reviews
September 2, 2014
This is not a book that one would read if they want to learn Python. This is a book that describes the language in a very literal sense. It discusses the makeup of the language in extreme detail, and you are absolutely assumed to have a good bit of prior programming knowledge (both Python and Object Oriented in general) in order to make any sense of the book.
Profile Image for becky bristol.
41 reviews
March 25, 2008
python what more can i say...i am learning all about programming in python and this book has been a great help
Profile Image for Robb.
36 reviews3 followers
May 6, 2011
This is one huge nutshell. The apt metaphor may have been 'python in a huge bag of python stuff'.
56 reviews1 follower
July 28, 2014
Unusable as a Python text. I don't know why I keep hoping these "in a Nutshell" books could jump start me in a language. They just don't work.
253 reviews3 followers
May 22, 2018
Lots of detail, perhaps too many in the beginning when it gets a little bogged down. But quite the breadth of information.
Profile Image for Mark Azevedo.
3 reviews1 follower
March 20, 2008
One of the best references I've ever read, although Python's online documentation is superb enough.
Displaying 1 - 21 of 21 reviews

Can't find what you're looking for?

Get help and learn more about the design.