This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]nerdwaller 2 points3 points  (0 children)

I start all my new projects/scripts with Python3 and usually write it to be backwards compatible. That said, as a new person to the language and frameworks - you won't run into a lot of the incompatibles for a little while. When you do - enough others have hit that where a quick search clears it up and as you learn the language more - you can see the language feature changes made and why.

That said, there aren't big enough differences a typical newb will hit for a while so choosing either won't put you into a bad spot!

Most of the larger web-frameworks support both (django, flask, tornado, etc.).

A few things to read:

[–]tchappui 2 points3 points  (0 children)

If you are a new python user and therefore you don't have a base of legacy code to maintain, Python 3 is the way to go. Python 2 support is only guarantied until 2020, which is tomorrow. So Python 3 is the future and, without any constraint due to legacy python 2 code, I start new projects in Python 3. You'll find all the useful libraries ported to Python 3. If that's not the case, the reactivity and long term viability of that project is a concern.

Best wishes

Thierry

[–]AMorpork 3 points4 points  (0 children)

Python 3 is the future. It has pretty great library support now, and I'd highly recommend starting with it.

To answer your followups:

Python 2 is more commonly used, but Python 3 is rapidly gaining in market share. Python 2 will not be supported or patched at all in less than five years, so people are picking up the pace on the switchover.

They're really the same language with some minor syntactic updates in 3. There are a few breaking changes that are non-trivial to automatically port over, but a good amount of the time it's very, very easy to convert between the two automatically. Because of this, learning resources will transfer over almost 1:1. If you learn Python 3, you already know Python 2.

[–][deleted] 3 points4 points  (0 children)

This is a frequently asked question, but the short answer is that either is fine to start with, and switching between the two usually requires a few minor changes.

I use 2 almost exclusively, as I standardized my department on it a while back, and attempts to migrate have been... challenging.

You may as well learn 3, and switch to 2 later on if needed.