I am taking a class that requires Python. We will review the language in class next week, and I am a quick study on new languages, but I was wondering if there are any really great Python books I can grab while I am struggling through the basics of setting up my IDE, server environment and all those other "gotchas" that come with a new programming language. Suggestions?
I found Learning Python really good. It's pretty long (>700 pages) but extremely readable and you can rip through it very quickly given you're a quick study :-)
I loved Dive Into Python, especially if you're a quick study. The beginning basics are all covered (and may move slowly for you), but the latter few chapters are great learning tools.
Plus, Pilgrim is a pretty good writer.
Since you're already familiar with other languages and a quick study, I'd recommend Python in a Nutshell by Alex Martelli, very concise and also useful later on for reference.
Two good online-books, that also describes the basics of the environment is diveintopython.org and the "official" tutorial.
Dive Into Python is an excellent book geared toward programmers wanting to pick up Python. The best part is that it's freely available online. I started learning a little Python a few months ago and I've worked through about half of the book. It's a very comprehensive tool that's good for learning the language and also for a reference down the road.
Edit: Kamens is a faster typer than I am.
Learning Python is how I learned the language. It's a quick read, and very well organized around fundamental concepts.
I have both Learning Python & Programming Python and I almost always go to the Pocket Reference first.
Many people have suggested Dive Into Python, which is probably the best Python book out there for someone who's already a good programmer. However, if you're new to programming, the best book is probably "How to Think Like a Computer Scientist: Learning With Python" (http://openbookproject.net/thinkCSpy/index.xhtml)
I'll second Daniel's recommendation of Python in a Nutshell. If you're quick to pick up new languages, it's probably exactly what you're looking for. There's a nice overview of how the language works, and then a discussion of most of the standard library. It's concise and clear, and doesn't assume that you don't know basic programming things already.
I think that Think Python is very good for first-time programmers. Pleasant writing style too..
I learned most of my initial pythonese from this super-handy quick reference:
I tried learning from Programming Python and I didn't like it. I'm going to give Python in a Nutshell a try as per suggestions below.
I quite enjoyed reading H.Deitel - Python - How to Program. It's very long but basics of Python are covered in first 300-400 pages. It's a nice book for beginners.
Dive Into Python is a good choice, but I also recommend Python Visual Quickstart Guide For someone that knows how to program and wants to get the 80% of the basics of the language, it's a good deal. And it retails at $20. It's certainly not the last thing I'd read on python, but it's a good first one.
I learned more from the python cookbook than any other python book.
I have to second (third? fourth?) Dive Into Python. It's just great for quick reference and reading. As an added suggestion, read some code! That always helps.
There are quite a few good books online. These have a broad scope, similar to O'Reilly's "Learning Python":
- Dive into Python by Mark Pilgrim
- How to think like a computer scientist: Learning with Python by Jeffrey Elkner, Allen B. Downey, and Chris Meyers
- Python Programming is a WikiBook
- The Python Tutorial is the "official" introduction to the language
Python.org maintains two lists of for learning python, depending on your level of programming expertise:
I highly recommend "Python Essential Reference" by David Beazley. You might find this sufficient if you're an experienced programmer and want a concise and comprehensive overview of the language. If you're a novice programmer this probably won't provide enough hand-holding. While I learned Python from other books, this is—by far—the most useful python book I own. Some notes:
- This is a reference book not a tutorial
- The first 125 pages are a complete overview of the language. It's not a tutorial, but it covers the language from top to bottom
- If you're an experienced programmer, this should be enough to learn the language
- If you're a novice programmer, start with a different tutorial
- The rest of the book is a comprehensive and extremely useful reference
- The 3rd edition covers up to python 2.4, but not beyond.
- The 4th edition is due for release in July 2009
Note: I originally posted the same/similar answer to this question. I was asked to put a copy of my answer here.
It may not be as applicable, but I just cracked open Programming in Python 3 by Mark Summerfield and so far it seems pretty good, although it is focused on Python 3, so if you're planning on learning something like Django, which hasn't made the jump to Python 3 and likely won't for some time, this book might not be the best. Additionally, even though Python 3.0 has been out for a little while now, I can almost guarantee your course is using Python 2.x. Academia has a tendency to trail behind. I had a C++ recitation professor who I swear wasn't aware that C++ has been updated since 1985.
I have also been using Programming in Python 3 by Mark Summerfield and find it very good.