I'm looking for a modern Python book, the latest one I have on my shelf is from before the 2/3 split, and I was hoping HN would have some recommendations?
To any beginners that come across this post in the future looking for introductory Python books, I tried many. The best I found in 2021 is Paul Gries's Practical Programming: An Introduction to Computer Science Using Python 3.6 An Introduction to Computer Science Using Python 3.6 [1].
I reccomend, as a first book, "Automate the boring stuff with Python". It may be rustic or dirty, but it gets the job done for anyone with some enthusiasm and a problem to solve. If you want to be a tidier or more pythonic programmer, or want to learn OOP, you can get that going on later.
How much is considered “knowing python”?
I use it with Django but never bothered to sit down and look at python itself to be honest. I’m just going to the docs and translating the basic syntax of other languages into what python has and it’s worked, but I may not know the tricks or whatever of the language
If you're looking for a refresher that outlines Python language fundamentals, I recommend "Introducing Python, 2nd Edition" (2019) by Bill Lubanovic [0].
Another really cool introduction that's filled with intermediate tricks is "Python Distilled" by Dave Beazley [1] (2021).
A couple of nice intermediate books:
"Intuitive Python - Productive Development for Projects that Last" by David Muller [2] (2021).
For intermediate or advanced Python, David Beazely's books are great.
I don't know of any beginning Python books as good as Learning Perl was back in the day. Python has gotten to be a confusing language and maybe not even the best choice for beginners any more though. What is the best choice then? I don't know. Each is terrible in its own way.
It teaches the language and many of its subtleties. It is fairly good to learn Python and is free. It is not however, a book for beginners in programming, it is for programmers wanting to learn Python.
That's an introductory CS book using Python, not a Python book. That is, it's focus is on using Python to teach general computer science, not on teaching Python.
It's good at what it does, but I wouldn't recommend it if your goal is primarily learning Python.
+1 on "Fluent Python" by Ramalho. I enjoyed and benefitted from the first edition so much that I'll get the second edition which is due to come out soon (Apr 29). I would say it targets intermediate developers more than beginners.
Some books I've read and think good:
1. the whirlwind tour of python
2. the Hitchhiker's guide to python
3. Writing idiomatic Python
4. Learning Python.
[1] https://pragprog.com/titles/gwpy3/practical-programming-thir...