The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Help finding a good Python Book

I've been doing a lot of reading on reviews and such for various python books, none of which escape some sort of flak. A few people say "Learning Python" is pretty dense and a few felt they couldn't write a simple program after reading many pages of the book. I may possibly try my hand at Django after learning it well. I was considering Ruby but Python just feels better suited for me, plus Rails framework runs better on Linux anyway.

So my question is can any recommend a good book to me? I've already ordered the "How to think like a computer scientist" Python book. If someone has read Learning Python and knows that it is good, that is fine. I just don't want to buy a bad book.

Naturally my aim is to learn the language. I'm experimenting in C++, Java, JavaScript, and lots of PHP right now. But Python is one of the languages I want to get serious with, along with C++ for a statically typed language and JavaScript for client-side scripting. I've learning some basic concepts, but I am still a novice.

I've already ordered the "How to think like a computer scientist" Python book.

Looking on amazon.com, that book is 7 years hold. I don't see how that is a good choice.

Edit:

Ah, I see. There is a new edition out.

If someone has read Learning Python and knows that it is good, that is fine. I just don't want to buy a bad book.

I thought the recently published "Learning Python(3rd ed.)" was terrible. I think the 2nd ed. must have been the one getting the good reviews. Hmm...amazon says they are coming out with a 4th ed. already.

python is going through a transitional phase right now from version 2.6 to 3.1. You might consider two newly published books:

Maybe it's just me, but I tried several books and nothing helped when I tried to learn C++ until I found cplusplus.com. Additionally, I learned Python painlessly from the The Python Tutorial. However, by the time I read the Python tutorial, I had already grasped all the fundamentals of programming, so maybe a book would be better. Nonetheless, I think you should give the tutorial a try if you have not already.

Thanks, I always like to read through the official documentation of the language. I still need to be introduced to the fundamentals of computer science thoroughly anyway, so I ordered that How to think like a computer scientist book.

Thanks, I always like to read through the official documentation of the language. I still need to be introduced to the fundamentals of computer science thoroughly anyway, so I ordered that How to think like a computer scientist book.

You get some fundamentals just from the old K&R book, ANSI C. I read two chapters, died, came back to life, started reading Merijn's eloquentjavascript.net and at the same time Crockford's book (rather randomly) and everyone seemed to just build on each other. Python, like Ruby and Perl and JS, take a lot from C. Or they take parts from it. If you are doing lots of math with any of your languages, then you'll need some good math behind you, as every place I've seen math explained already assumed you have like a BS in advanced mathematics lawlz (or actually, they assume you were required to take some certain maths as a Computer Science student).

If you go ahead and look at Ruby while you are looking at Python you'll see a lot of similarities. It's possible that where the two languages do the same thing, one book/resource explains one part better than another book. They may compliment each other. I'm doing this with Perl and Javascript right now. Syntax get mixed up horribly, but the basics are remarkably the same (that and JS took a lot from Perl, namely the regexes and dealing with arrays).

I guess the Snake Wranglers or whatever they were are gone now, but finding a Python community to steer you in the right direction every time you come to interesting areas can't hurt. There are always a lot of things in a language that are legal but the programmers who know the language consider a Bad Idea.

Man, I don't know how you can argue that Python takes a lot from C, other than the fact that they both happen to be programming languages.

I can't think of a syntax and paradigm that is more different than C.

C is a procedural functional language with manual memory management and doesn't even have a string primitive, and Python is a dynamically typed reflective OOP language with indentation based scope!

Ruby is what all the cool kids are doing, but Python is way better if you use Django. I am a major advocate of Django, and the choice between Django and Rails really comes down to what you hate doing more. They both have negatives.

I learned Python from online tutorials but it didn't take long. If you want to start developing sites with it, pick up The Definitive Guide to Django, which was just updated last month for 1.1

C is a procedural functional language with manual memory management and doesn't even have a string primitive, and Python is a dynamically typed reflective OOP language with indentation based scope!

You can't deny that the current generation of OOP languages take many of their ideas from C. I'm not saying they work like C. I'm saying they borrowed the hell out of it. And a language who borrows from a language who borrowed from C also counts. Perl is also not a functional language either but inherits/borrows plenty from C. Python and Ruby have borrowed from Perl (and Perl is currently borrowing back from those two).

Maybe the best analogy I can think of right now is learning Latin and Greek can help you get fundamentals of English, who is nothing like Greek or Latin but borrows the hell out of both languages. And I don't mean learning to speak Latin or Greek. That's only useful if you want to speak Latin or Greek. But learning the vocabulary, and how your language took, used and changed that vocabulary or that set of grammar is so nice. You can learn to skim a language enough to learn it and be plenty fluent in it, but I believe it's a benefit to see where this and that came from, and why.

But my main point wasn't to learn C, but that the fundamentals of programming, whether in Python or anyone else, can be learned or at the very least helped along by the K&R book. I don't get half of what I'm reading in it, but ok. Every time I go back there's something new in there that I finally "get". Raven-X is interested in learning more general computer theory or whatever along with the Python learning. This sounds like a good idea. Hence my suggestion. : )

I'm studying PHP, Python, JavaScript, and C++, along with SQL for databases. Once I learn the basics it'll transfer to all languages, the minor differences are much easier to overcome.

Kind of like if you want to be a professional illustrator, you need detailed knowledge of real world anatomy. Learning an illustration style is simple, the basics are what really count.

Even simple concepts like variables and arrays are extremely important topics in programming. What I love about it is that it's like a puzzle. Many intricate pieces interact to create something that does something.