Ask YC: What is the best Python book for a beginner?
I'm looking to learn more about Python and want to buy a book to read in my spare time (and I do know of the online Python docs, the free Dive into Python website, etc). Can anyone recommend a book that is up-to-date (i.e., covers 2.5)?
Looking at Amazon, I'm leaning towards Learning Python, 3rd Edition (http://tinyurl.com/2az6zh). Any opinions on this one?
Thanks for the help.
23 comments
[ 3.6 ms ] story [ 76.4 ms ] threadhttp://docs.python.org/whatsnew/whatsnew25.html
The language docs from python.org are invaluable as a reference, which includes the tutorial. I invariably download the html tarball and put it on any machine I use for python programming.
I started learning Python from a Mark Lutz seminar actually. He is a great teacher.
You'll find a limit to your knowledge of python if you just start hacking. Knowing C and how python is built help build an intuition for how things really work. I find it invaluable.
http://en.wikibooks.org/wiki/Programming:Python
Maybe I'm being lazy, but more practical, show me, types of tutorials work best for me.
I'd rather recommend http://projecteuler.net
I'd suggest skimming the table of contents of both books first.
Then again, Dive Into Python is free, so you might as well start with that, and if it's too advanced, switch to Learning Python (I read the first 100 pages of it last summer, and I thought it was good, I'm a fan of O'Reilly).
If you really want a beginner book, Learning Python is a great choice. It was just updated too. Good luck.
I tend to bounce around in what I learn and try to look at things from different angles. I find that different authors cover one subject better than another. And, thay way, I don't have to feel bad about buying the book and only reading 2-3 chapters out of it.
I started with Beginning Python: From Novice to Professional. Extremely helpful and easy to follow book, since I already have few languages in my repertoire.
After you are comfortable with python and its syntax then get some python cookbooks.
Good Luck
http://python.eventscripts.com
Tutorials (some are pure Python, others are game-related:
http://python.eventscripts.com/pages/Category:Tutorial
One kinda neat example:
http://python.eventscripts.com/pages/Mugmod
I personally recommend How To Think Like A Computer Scientist (http://openbookproject.net/thinkCSpy/). It doesn't cover everything in 2.5, but I think most of the stuff in 2.5 you're better off just reading the release notes after you have a basic grasp on the pre-2.5 stuff. You're going to be reading a lot of code to master the nuances of Python, and most of it is pre-2.5 Python, so you should know it well.
If you want to use that book, there's also assignments and projects available from UC Berkeley's self-paced Python course, CS 9H, at http://www-inst.eecs.berkeley.edu/~selfpace/cs9honline/ if you want more structure.
"Learning Python" and especially "How to think like a computer scientist" are targeted towards people with very little programming experience. If that's you, my vote goes to "How to think like a computer scientist" (ymmv).
http://www.greenteapress.com/thinkpython/