Cover of Python Cookbook

Python Cookbook

by Alex Martelli, David Ascher, David M. Beazley, Brian K. Jones · first published 2002

39mentions
17recommended by
32HN commenters
2008–2024first – last mentioned

53% recommend44% neutral3% critical

Why HN recommends it

Recipe-based tour of idiomatic Python that shows how experienced Pythonistas solve common problems through working code. Suits intermediate and advanced programmers who learn from examples rather than syntax reference.

Summarised by Claude from recommending comments

Portable, powerful, and a breeze to use, Python is the popular open source object-oriented programming language used for both standalone programs and scripting applications. It is now being used by an increasing number of major organizations, including NASA and Google. Updated for Python 2.4, The Python Cookbook, 2nd Edition offers a wealth of useful code for all Python programmers, not just advanced practitioners. Like its predecessor, the new edition provides solutions to problems that Python programmers face everyday. It now includes over 200 recipes that range from simple tasks, such as wo

Affiliate links. As an Amazon Associate I earn from qualifying purchases.

Mentions per year

70 2007: 0 mentions2008: 1 mention2009: 1 mention2010: 0 mentions2011: 7 mentions2012: 1 mention2013: 1 mention2014: 2 mentions2015: 1 mention2016: 1 mention2017: 5 mentions2018: 6 mentions2019: 1 mention2020: 1 mention2021: 2 mentions2022: 0 mentions2023: 4 mentions2024: 1 mention2025: 0 mentions2026: 0 mentions200720172026

What Hacker News says

  • Jugurtha · Oct 28, 2017 · Recommends

    …doesn't necessarily think about but that simplify life: virtual environments, unit test, project structure, good practices, scenarios for different kinds of applications, documentation, etc. Doing stuff: "Python Cookbook" (several editions by different authors, Alex Martelli and David Beazley): as the title states, it's a cookbook that shows you how to do a bunch of stuff in Python (files, network, threads, etc). This…

    on “Ask HN: What's the best source to learn idomatic Python?” ↗
  • 100qs · Aug 17, 2018 · Recommends

    …Google's python course, as it is geared toward python devs working at Google. The course teaches Python 2, and goes against widely accepted guidelines such as PEP-8. I highly recommend David Beazley's Python Cookbook (https://www.dabeaz.com/cookbook.html) for the most idiomatic and comprehensive introduction to Python.

    on “Ask HN: How did you learn python?” ↗
  • Jugurtha · Mar 27, 2021 · Recommends

    …doesn't necessarily think about but that simplify life: virtual environments, unit test, project structure, good practices, scenarios for different kinds of applications, documentation, etc. Doing stuff: "Python Cookbook" (several editions by different authors, Alex Martelli and David Beazley): as the title states, it's a cookbook that shows you how to do a bunch of stuff in Python (files, network, threads, etc). This…

    on “Ask HN: Catching Up with Python – Resources?” ↗
  • aurelio · Nov 27, 2008 · Recommends

    …guides http://www-inst.eecs.berkeley.edu/~selfpace/cs9honline/ to good feedback for an introduction to python and programming in general, while myself mostly relying on the books by Alex Martelli (Python in a Nutshell and Python Cookbook)

    on “What did you use to teach yourself Python?” ↗
  • russell · Mar 15, 2009 · Recommends

    If you know a little Python, I recommend the Python Cookbook by Alex Martelli http://www.amazon.com/Python-Cookbook-Alex-Martelli/dp/05960... It is completely different from other types of books which are either references or tutorials which build some kind of…

    on “Ask HN: Good Programming Books to Teach Programmers New Languages?” ↗
  • pillmuncher · Apr 30, 2011 · Recommends

    I recommend The Python Cookbook: http://oreilly.com/catalog/9780596001674. It's not a reference in the sense that it shows you the language syntax or tells you the details of the standard library, but it shows how experienced Pythonistas…

    on “Ask HN: ______ is to Python as K&R is to C?” ↗
  • espeed · Apr 30, 2011 · Recommends

    …of recommended online Python tutorials, in order from introductory to more advanced (http://www.quora.com/How-can-I-learn-to-program-in-Python/an...). It also includes my dead-trees recommendation -- "Python Cookbook," by Alex Martelli.

    on “Ask HN: ______ is to Python as K&R is to C?” ↗
  • bdevine · May 12, 2014 · Recommends

    I liked the latest edition of "Python Cookbook" by Beazley and Jones for precisely this.

    on “Unicode in Python 3” ↗
  • drallison · Aug 13, 2017 · Recommends

    …manual (a MUST), write some programs, and read some other people's programs. Python is a simple language. Reading other people's programs is a good way to apprentice when learning a new language. The Python Cookbook(s) and the 3rd edition of Python in a Nutshell make good reading. Python comes in two variations these days: Python2 and Python3. Python3 would be the best choice for a new learner.

    on “Ask HN: Python?” ↗
  • Snawoot · Nov 27, 2018 · Recommends

    …we can reduce it to first case by building two triangles and constructing angle between hypotenuses. Useful links: https://en.wikipedia.org/wiki/Farey_sequence https://www.oreilly.com/library/view/python-cookbook/0596001... - python implementation of search in Farey sequence.

    on “60-degree angles on a lattice” ↗
  • neoncontrails · Oct 4, 2019 · Recommends

    …so many examples of functioning code was very beneficial. Quick sidebar: if you're looking for an intermediate/advanced-level book with a similar style of pedagogy, I can't recommend highly enough The Python Cookbook by David Beazley. There are recipes in that book that I'm quite honestly unsure how I would function without. And to the credit of the author, every code example functions as a complete, minimal, working…

    on “Fundamentals of Python Programming [pdf]” ↗
  • hgoury · Apr 12, 2020 · Recommends

    Such an amazing talk ! Someone linked to this on HN a while back, this allowed me to discover David Beazley. I then got the Python Cookbook, and watched a bunch of other very cool talks. He's an excellent speaker and python wizard!

    on “Bored? How about trying a Linux speed run?” ↗
  • emmelaich · Jan 29, 2023 · Recommends

    If you consider yourself a good programmer, read the official reference documentation. A good book was Essential Reference by Beazley but I don't think it was updated for Python3 yet. Also perhaps Python Cookbook. A major part of any language is knowing the standard library(-ies).

    on “Ask HN: Which book would you recommend for learning Python in detail?” ↗
  • vram22 · Jan 31, 2016 · Recommends

    …though maybe not of the same kinds that you describe, i.e. may not be at machine language level. Tim Peters did a lot of that, per what I read, though others may have too. [1] Think I read it in the Python Cookbook, 2nd Edition, which is a very good book, BTW.

    on “Ask HN: What's the most elegant piece of code you've seen?” ↗
  • tusharsadhwani · Oct 10, 2021 · Recommends

    I can personally recommend Fluent Python (its 2nd edition is about to come out in a couple months) for learning these intermediate/advanced concepts, and Python Cookbook for code examples using many of these features. I don't know any books for projects per-se, maybe HN will know!

    on “Understanding Python through its builtins” ↗

Keyboard shortcuts

/
Focus search
j / k
Next / previous book
Enter
Open focused book
Esc
Close / go back
g h
Go to Home
g t
Go to Top all-time
g m
Go to Most recommended
g r
Go to Rising
g f
Go to For You
?
Show this help