User avatar
friendl
Posts: 5
Joined: Fri Mar 29, 2013 1:24 pm

Learn Python 2 or 3?

Tue Jul 28, 2015 9:31 pm

Hi all,

I've been reading from various resources online, one tells me to stick to Python 2, the other Python 3 for it's the future.

What do you recommend for programming on the R'Pi?

User avatar
friendl
Posts: 5
Joined: Fri Mar 29, 2013 1:24 pm

Re: Learn Python 2 or 3?

Tue Jul 28, 2015 9:42 pm

A follow up, a bit more searching, found this useful guide on 2 vs 3:

https://wiki.python.org/moin/Python2orPython3

Looks like learn 3 makes more sense if you're new to the language.

metalj
Posts: 212
Joined: Sat Feb 07, 2015 11:56 pm

Re: Learn Python 2 or 3?

Tue Jul 28, 2015 9:47 pm

Your probably going to learn both. Most books are 3 and codecademy is 2. It seems like you have to choose but the only thing you have to do is stick with it till the end of your lessons.
Backspace 28 times :)

User avatar
paddyg
Posts: 2359
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Learn Python 2 or 3?

Wed Jul 29, 2015 8:24 am

There used to be quite a few modules that hadn't been converted from 2 to 3, but in Apr 2014 (when the doc in you link was last updated) it was a small proportion - significantly smaller now!

As you have just discovered the python2 v python3 issue is an annoying confusion with an otherwise very good language. It's probably time that all python advocates started giving a clear "3" in answer to your question. And hasten the demise of python2!
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: Learn Python 2 or 3?

Wed Jul 29, 2015 8:44 am

paddyg wrote:As you have just discovered the python2 v python3 issue is an annoying confusion with an otherwise very good language. It's probably time that all python advocates started giving a clear "3" in answer to your question. And hasten the demise of python2!
Yes, I think that's probably the right answer too.

However, it's useful to understand both and their differences especially if you want to adapt someone else's (older) code which was written in python 2.

Personally, I've never used python 3 but that's because I got into to python in order to write addons for XBMC/Kodi and they had to be python 2. So my hand was forced, but I have no regrets and have yet to come to a situation where I've needed python 3 (but maybe that's just because I haven't been adventurous enough yet!).
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

Return to “Python”