tags:

views:

1272

answers:

6

Hello,

I'm a programmer with a heavy background in web application development (mostly PHP but also ASP), and some C/C++ and Java knowledge as well.

My interest in Python has been growing a lot lately, and I'm wondering if I should start with the recently released Python 3, or with the older but really Python 2.x ?

Thank you. Nicolas

+1  A: 
MadKeithV
+3  A: 

The two are very similar. The big question is whether you want to use 3rd-party libraries and frameworks, most of which haven't been ported to 3.0 yet (e.g. Django, NumPy). If so, go with Python 2.x; if not, you should start with Python 3.0. In any case, as MadKeithV said, the differences are quite minor, and there's a tool called 2to3 that will automatically convert Python 2 code to Python 3.

RexE
A: 

Although differences between Python 3 and 2.X are small, there are two aspects to consider. It's easier to find references and examples for 2.X, but on the other hand learning 3 might give a slight advantage for future needs.

A: 

There's not a lot of difference. If you start with Python 3 and later on have occasion to work on Python 2.x code the differences will be minor - an annoyance at worst. If you start with Python 2 you may find yourself having to port to Python 3 at some point. However, Python 2 will be around for quite a while yet.

Start with whatever is current. 3 might be a little bleeding edge for a few months, so it might be easier to start with 2.5 or 2.6 and move to 3.0 in a year or so. Note that I have had Python 2.2, 2.3 or 2.4 on machines long after later versions came out in order to deal with bugs or compatibility issues.

For example, MakePy would break on Excel in version 2.4 as it generated a file that exceeded a size limit on Python 2.4. I used 2.3 for a while until the bug was fixed.

I still have 2.4 on a machine now as I haven't had any need to upgrade it.

ConcernedOfTunbridgeWells
+2  A: 

I'd start with Python 2.6 as it will probably work very well with all (or at least most) existing libraries, and it allows you to run it with a "-3" flag to warn about things that will break in Python 3.

The new things in Python 3 will, as others have already stated, be easy for you to get a hang on once you learn 2.x.

kigurai
I didn't know about the -3 flag... +1
Unkwntech
A: 

It's like asking is American English a good starting point when you want to learn English.

It's the same language with nearly identical syntax. Better question would be what version of Python interpreter to use. Since you probably want to use libraries besides the standard one, and most of it isn't yet ported to 3.0, use version 2.6. And since you are just beginning Python I doubt you'll have a large code base to port to 3.0, but it still might be wise to run your interpreter with "-3" switch.

Mosor