tags:

views:

1803

answers:

10

I've been coding in PHP for almost ten years, but I've lately become interested in Python. What Python book would you recommend?

+18  A: 

Dive Into Python by Mark Pilgrim.

John Millikin
thanks for the link. great resource!
arin sarkissian
It's a great book, but not sure it will talk to a php coder : it's full of references to Java and C#, but absolutely nothing about PHP.
e-satis
I agree that it's a good book, but you should probably read the new edition: http://www.diveintopython3.org/. The old one's a tad dated.
Michał Marczyk
Re Dive into Python 3: sure, although I reckon in practice it’ll be necessary to know Python 2 and 3 for the next few years.
Paul D. Waite
A: 

I'll second that, Dive into python probably is the way to go but it might be boring at some points if you already know object oriented programing.

Gustavo Rubio
+5  A: 

Python in a Nutshell, by Alex Martelli. It's a great language guide, and it can also serve as a tutorial.

Bruno Gomes
+1  A: 

In addition to the already mentioned Python in a Nutshell, let me strongly recommend the Python Cookbook : http://oreilly.com/catalog/9780596007973/?CMP=AFC-ak_book&ATT=Python+Cookbook

torial
+2  A: 

How about good old Programming Python by O'Reilly?

The reason I suggest it is: you already know what dynamic languages are about, you already know how to program in general. This book doesn't belabor syntax and basic concepts. It shows you what's unique and cool about Python, and then jumps straight into the myriad modules and features of the available Python libraries, with a specific focus on web programming.

It's a very large book and valuable equally as a reference and a way to simply inspire you to do cool things with Python. (The only downside is that it's a little too long and varied to read "all at once" as I like to do.)

Dan
+1  A: 

I used to code PHP and switched to Python recently. I recommend 2 books.

  1. "Dive Into Python". It's concise and suit someone who have a background in programming already.

  2. Another book is How to Think Like a Computer Scientist, this one is for newbie though. Since you are not, I don't recommend you to read it. However, I think the book's exercises are very good for everyone who is new to Python.

A: 

I'll go for Dive into Python as Well.

But I realize how cool it would be to create a book edition "from language x to language X". Espacially with python, php and perl (the subject come back really often) and from python to C / java (so if you've started with python, you can learn these more easily, otherwise it will feel like a pain in the ass as for me : C seemed so horrible from a pythonista point of view).

e-satis
A: 

I second Dive Into Python. There are also lots of other great Python books available online for free.

Ben Dowling
A: 

Any suggestions for a jython book for a php programmer?

Nitin Garg
You might want to ask this as a question, rather than posting it as an answer. You’ll likely get more answers that way.
Paul D. Waite
A: 

I’d recommend Learning Python (4th Edn.), by Mark Lutz as well.

It’s a very thorough treatment of the concepts of the language, as opposed to Dive into Python’s practical approach. I think they complement each other well, if you’re up for a lot of reading.

The 4th edition is good at covering the differences between Python 2 and 3.

Paul D. Waite