Python - what version


4 posts
by boliveruk » Wed Jul 25, 2012 7:21 am
As a person new to Python, and all modern languages (I last programmed in BBC Basic) what is the best version to use. I note that my SD Card has versions 2.x and 3.x. Which would be best to use and is code in one compatible with the other. I would rather not have to re-key anything I coded in the earlier version.
Posts: 2
Joined: Mon Jul 23, 2012 6:59 pm
by jbaiter » Wed Jul 25, 2012 11:22 am
If you don't need libraries that haven't been ported to Python3 yet, I definitely suggest going the Python 3 route.
User avatar
Posts: 13
Joined: Tue Jul 03, 2012 7:52 pm
by texy » Wed Jul 25, 2012 11:52 am
The question gets asked every week, so search those threads for the pro's and con's. The above post gives one reason, another is what you plan to do with python? You would need to do very little keying, but library support for your choice of python is one major factor. Another may be your choice of tutorial or book, as it may use one or t'other.

Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2353
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by antiloquax » Fri Jul 27, 2012 6:16 am
Python 3 comes with a script called 2to3 which converts python 2 code to python 3.

I would recommend going with Python 3, if you are a beginner.
There are some links to good tutorials on my website:
RaspberryPy.co
Posts: 406
Joined: Sun Nov 20, 2011 11:37 am