-
- Posts: 3
- Joined: Mon Mar 05, 2012 6:35 pm
Re: Should I learn python 2 or python 3?
After rooting around on the Internet for a while I"ve seen loads of tutorials for python 2 and python 3 but which one will come with the Raspberry Pi itself? It"s just I want to give myself a head start before I get it
Re: Should I learn python 2 or python 3?
There is very little difference between Python 2 and 3. I suggest you go with python 3 as it is the way forward for python as a language.
-
- Posts: 3
- Joined: Mon Mar 05, 2012 6:35 pm
Re: Should I learn python 2 or python 3?
Thanks I"ll get started then
Re: Should I learn python 2 or python 3?
AnotherToothbrush said:
Thanks I"ll get started then
AnotherToothbrush said:
After rooting around on the Internet for a while I"ve seen loads of tutorials for python 2 and python 3 but which one will come with the Raspberry Pi itself? It"s just I want to give myself a head start before I get it
Hi, I am a starter too. I decided to start wit version 2 since I am very intersted in the library scipy and numpy for math and scientific applications. These are not available in version 3 yet.
Have a look at this book here:
http://www.itmaybeahack.com/ho.....ython.html
It is free, teaches version 2 and gives hints what will change with version 3, very good approach.
Thanks I"ll get started then
AnotherToothbrush said:
After rooting around on the Internet for a while I"ve seen loads of tutorials for python 2 and python 3 but which one will come with the Raspberry Pi itself? It"s just I want to give myself a head start before I get it
Hi, I am a starter too. I decided to start wit version 2 since I am very intersted in the library scipy and numpy for math and scientific applications. These are not available in version 3 yet.
Have a look at this book here:
http://www.itmaybeahack.com/ho.....ython.html
It is free, teaches version 2 and gives hints what will change with version 3, very good approach.
Re: Should I learn python 2 or python 3?
Hi, I am a starter too. I decided to start wit version 2 since I am very intersted in the library scipy and numpy for math and scientific applications. These are not available in version 3 yet.
Have a look at this book here:
http://www.itmaybeahack.com/ho.....ython.html
It is free, teaches version 2 and gives hints what will change with version 3, very good approach.
Have a look at this book here:
http://www.itmaybeahack.com/ho.....ython.html
It is free, teaches version 2 and gives hints what will change with version 3, very good approach.
-
- Posts: 119
- Joined: Tue Jan 24, 2012 10:10 pm
- Location: Eastleigh, Hampshire
- Contact: Website
Re: Should I learn python 2 or python 3?
This isn't an easy question to answer. The basics though are:
Go with Python 3 if you just want to learn the language and aren't interested in doing anything "serious". Why? Because a lot of the key libraries for doing "cool" stuff haven't been converted to Python 3 yet.
This brings a dilemma though, as you will soon find that you want to use external libraries.
The easy solution though is to install both. For instance I have Python 2.7 and Python 3.2 and they install in separate directories. Some packages/libraries will look for the version of Python they need but some don't. In this case, if you're knowledgeable about what the PATH environment variable is, you can force the use of one or the other by removing the one you don't need from the PATH.
Final answer? Install both.
Go with Python 3 if you just want to learn the language and aren't interested in doing anything "serious". Why? Because a lot of the key libraries for doing "cool" stuff haven't been converted to Python 3 yet.
This brings a dilemma though, as you will soon find that you want to use external libraries.
The easy solution though is to install both. For instance I have Python 2.7 and Python 3.2 and they install in separate directories. Some packages/libraries will look for the version of Python they need but some don't. In this case, if you're knowledgeable about what the PATH environment variable is, you can force the use of one or the other by removing the one you don't need from the PATH.
Final answer? Install both.
Have more FUN with your Pi. Visit www.pi-fun.com
Re: Should I learn python 2 or python 3?
Although the answers given here make sense they do not answer the original question, which version will the raspberry Pi have on board? I have just started to learn 3.2.3 but if I get the Pi and find that it is running with version 2.xx then there are quite a few differences between the versions.
Does anyone know what version of Python will be on the Pi?
Does anyone know what version of Python will be on the Pi?
- nick.mccloud
- Posts: 1144
- Joined: Sat Feb 04, 2012 4:18 pm
Re: Should I learn python 2 or python 3?
AFAIK, the educational release will use Python 3 but it's just Linux, you can install either or both with just one command and then use either or both as you want/feel/need.
Pico/RP2040 ≠ Arduino
Pico = hot rod kit car, Arduino = hot rod kit car wrapped in cotton wool with buoyancy aids & parachute
Pico = hot rod kit car, Arduino = hot rod kit car wrapped in cotton wool with buoyancy aids & parachute
Re: Should I learn python 2 or python 3?
It's ben said before on here that Python 3 should be used for teaching, because in the next year or two it will be the standard, but Python 2 should be used for learning because many libraries have not yet been ported.
You can write the Python 3 code under Python 2 if your file begins with the line:
With that line in place, your code will work with either Python 2 or Python 3. There may be rare cases in which it doesn't work, but I have not found any,
You can write the Python 3 code under Python 2 if your file begins with the line:
Code: Select all
from __future__ import absolute_import, division, generators, unicode_literals, print_function, nested_scopes, with_statement
Re: Should I learn python 2 or python 3?
Well, bare in mind that there are multiple distributions of GNU/Linux available for the Pi so the Python version may vary between them...dashby wrote:which version will the raspberry Pi have on board?
The Debian build, which is the recommended distro currently, contains 2.6.6. But of course Python 3 can be installed separately as has been suggested already.
An interesting thing to note is that the Raspberry Filling project will be documenting Python 3. See the post here which discusses it.
So I guess it's undecided at the moment. The Python situation will likely become clearer as it nears the educational launch.