views:

95

answers:

1

I ordered three books to start teaching myself Python - a beginning programming book, a computer science book that uses Python for all of its code references, and a book on Python network programming. Unfortunately, I was a little too quick on ordering them, because I hadn't noticed the version differences. The beginner book is for python 3.1, the CS book is Python 2.3, and the last is Python 2.6. The CS book is also oriented towards beginners. My question is, will the different versions be too different at this level for me to effectively use all three, or will I likely be able to get by learning from the 3.1 beginners book and then sort of teach myself from the 2.3 CS book, and be able to comprehend 2.6 code?

That probably didn't make sense. I hope it did.

+3  A: 

99.8% of 2.3 code is valid in 2.6. The 3.x book should be able to backfill the 2.x knowledge from 2.4 on, assuming it actually touches upon the relevant subjects. See the various "What's New" documentation to see, well, what's new.

Ignacio Vazquez-Abrams
and the 0.2% remaining will be mostly allways converted successfully to 3.x using the provided 2to3 utility
MatToufoutu
@MatToufoutu: Except we're talking about 2.3 to 2.6, not 2.x to 3.x.
Ignacio Vazquez-Abrams
Part of that 0.2% is the `print` statement (in 2.x) which becomes the `print()` function in 3.x. If you search SO for `[python] print` you'll see every variation of confusion caused by this. The `2to3` utility spots it, and running Python 2 in `-3` mode will help you spot it also.
S.Lott
@S.Lott. No it isn't. `print` is still a statement in 2.6.
Ignacio Vazquez-Abrams
@Ignacio Vazquez-Abrams: Agreed; that's why I said "2.x".
S.Lott