Skip to content
HomeVideosBooks
AllTopicsTrends
BlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    Cover of Python Cookbook

    Python Cookbook

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

    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 working with dictionaries and list comprehensions, to complex tasks, such as monitoring a network and building a templating system. This revised version also includes new chapters on topics such as time, money, and metaprogramming. Here's a list of additional topics covered: Manipulating text; Searching and sorting; Working with files and the filesystem; Object-oriented programming; Dealing with threads and processes; System administration; Interacting with databases; Creating user interfaces; Network and web programming; Processing XML; Distributed programming; Debugging and testing. Another advantage of The Python Cookbook, 2nd Edition is its trio of authors---three well-known Python programming experts, who are highly visible on email lists and in newsgroups, and speak often at Python conferences.

    ProgrammingComputer Science
    Open LibraryAmazon
    Stats for nerds
    17recommend
    39mentions
    32people
    2008–2024years
    62% recommend36% neutral3% critical

    Mentions per year

    200820102012201420162018202020222024

    What Hacker News says

    1. emmelaichAug 2023
      I guess not so much games/websites but something you can see yourself using.

      Roman numeral conversion is not one of those. Neither, for example is SICP's example of Newton-Raphson.

      I don't want to bang on about it. They're fine books. Just could have used an better editor or some other constructive advice to make it less niche and more relatable.

      FWIW I also bought Learning Python which was meh, and Python Cookbook which is directly useful.

      thread
    2. emmelaichJan 2023
      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. [edit: http://www.dabeaz.com/python-distilled/ is the Python3 version]

      Also perhaps Python Cookbook.

      A major part of any language is knowing the standard library(-ies).

      thread
    3. JugurthaNov 2021
      If he's read a few books and knows generators, etc, then I suggest:

      "Python Cookbook", which shows you how to do many things (files, networks, servers, binary, data handling). It effectively is a cookbook and helps you have or be aware of several "recipes" to do common things.

      To write better Python: Brett Slatkin's "Effective Python: [59|90] Specific Ways to Write Better Python" will get him to write good quality Python code "in general". This could reassure potential employers to some degree.

      Having some familiarity or experience with the domain of the organization helps. Python is Python, but there are several subtleties in working writing code that encodes to/decodes from binary packets, or with systems work, or audio processing, etc.

      It will depend on whether these companies want someone who "can code", or someone who "can code in Python", or "someone who can code X in Python because that's we're doing X in Python".

      thread
    4. tusharsadhwaniOct 2021
      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!

      thread
    5. JugurthaMar 2021
      It depends what you used to do with Python, really. There are a lot of users whose code didn't change from 2.x to 3.x except for the print "statements".

      I replied to similar threads[0][1], reproduced here:

      """

      The Python documentation is pretty cool. I frequently go to Chapter 3 (Data Model) and always learn something new reading something I had already read but didn't quite get. The mailing list has top notch posters who are always willing to help.

      The IRC channel (#python) has very helpful members who've been patient with me on more than one occasion.

      Books:

      Stacking the deck:

      "Python Guide" - Kenneth Reitz: The bits one 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 can get you "operational" in Python pretty fast.

      Doing stuff well (meta):

      "Writing Idiomatic Python" - Jeff Knupp:

      The book comes for Python 2 and Python 3 and contrasts "harmful" and "good". Jeff Knupp also has videos showing you the process of refactoring code. He also has a blog (https://jeffknupp.com/) where he addresses many topics.

      "Effective Python: 59 Specific Ways to Write Better Python" - Brett Slatkin: Pretty good book. The subtitle says it all: 59 specific ways to write better Python. (600 + pages).

      "Learn Python the Hard Way" - Zed Shaw: I've read that starting out in Python. Maybe not for a 15 year Perl veteran, but this is for memo.

      There's certainly some overlap in these books, but it helps to repeat a message to understand the importance of something, or to drive a point home. I didn't use virtual environments until the message was repeated enough in different ways.

      Pornography:

      PyCon talks. A lot of these are great.

      David Beazley (a bunch of talks that are pretty cool. Still haven't finished the ones on generators but they're very good).

      Brandon Rhodes (on aesthetics and design patterns (or lack thereof), and testing web applications).

      Kenneth Reitz on design.

      Raymond Hettinger (you'll find "Writing Beautiful Idiomatic Python" and "Beyond PEP8" most helpful).

      """

      """

      Not a channel, but talks by David Beazley on Python topics are gems. High insight density. The presentation are often 60+ pages, and you can spend hours playing with each concept in every 'slide'. His talks are rabbit holes. Raymond Hettinger tweets snippets of code that are delicious. His talks are really useful, too. Specifically, the one entitled 'Beyond PEP8' which focuses you on the impact you can have by zooming out of details and concentrate on good design.

      This is something I've been using. I write code that uses a yet to be API, and ask myself and colleagues if it makes sense for them to use it.

      For example, I'm writing a Python wrapper for MinIO's admin command line interfaces 'mc' and 'minio' which the Python client lacks. Put up the docs first at https://big-mama-tech.gitlab.io/bmc and asked colleagues and the MinIO folks if it's acceptable/useful before really going for parity.

      """

      - [0]: https://news.ycombinator.com/item?id=15576496

      - [1]: https://news.ycombinator.com/item?id=24671742

      thread
    6. hgouryApr 2020
      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!
      thread

    Related

    Cover of Python in a Nutshell
    2008–2024

    Python in a Nutshell

    Alex Martelli
    9 recommend · 23
    Cover of Java Cookbook
    2016–2017

    Java Cookbook

    Ian F. Darwin
    2 recommend · 2
    Cover of Arduino Cookbook
    2012–2022

    Arduino Cookbook

    Michael Margolis
    2 recommend · 4
    Cover of The Hitchhiker’s Guide To Python
    2012–2023

    The Hitchhiker’s Guide To Python

    Kenneth Reitz
    26 recommend · 28
    Cover of Learning Python
    2007–2026

    Learning Python

    Mark Lutz
    26 recommend · 49
    Cover of Effective Python
    2012–2026

    Effective Python

    Brett Slatkin
    22 recommend · 45
    Cover of Computer lib
    2008–2026

    Computer lib

    Ted Nelson
    10 recommend · 41
    Cover of Code Complete
    2007–2026

    Code Complete

    Steve McConnell
    393 recommend · 894