1

I'm not quite sure what the real differences are so I'm not able to decide which version is better for a beginner.

I have a background about C, C++ and Java basically, i would like to start Python because i need it, this will look like a noob question but i really don't know which version i'm supposed to pick; for what i see the difference between 2.x and 3.x are mostly related to the syntax used in the two versions, but since i don't even have started anything yet i know nothing so i ask: which one I'm supposed to pick ?

user1717079
  • 493
  • 2
  • 4
  • 16
  • 2
    This question has been asked so many times: [here](http://stackoverflow.com/questions/4570006/take-up-python-3-x-or-2-x?rq=1) and [there](http://stackoverflow.com/questions/3253430/python-2-x-or-3-x?rq=1) just to name a few... – jadkik94 Oct 15 '12 at 20:03
  • 1
    possible duplicate of [Should I learn Python 2 before 3, or start directly from Python 3?](http://stackoverflow.com/questions/170921/should-i-learn-python-2-before-3-or-start-directly-from-python-3) – Marcin Oct 15 '12 at 20:06
  • 1
    And apart from being a dupe, it's also non-constructive, I'm afraid. And too localized, as 3.x will eventually replace 2.7 altogether as projects move on. – Martijn Pieters Oct 15 '12 at 20:06
  • 1
    I would start with Python 2.7. It is supported by py2exe, Django and most importantly: [PyPy][1] which ay give you a speedup of 5X, which may be nice if you will use Python as a complement to C++/Java. As a complement, you will probably often want to run small script files as fast as possible , and for such tasks, Python is a wonderful "glue" language, and PyPy takes the edge of some of the slower parts by introducing a good JIT. py2exe and PyPy is NOT supported in Python 3.X (yet). [1]: http://pypy.org/ – Storstamp Oct 15 '12 at 20:17

3 Answers3

3

You can start with any of the version you want. Syntax are almost similar, the major differences can be found here:

http://docs.python.org/release/3.0.1/whatsnew/3.0.html

For learning though I would suggest 3.x because 2.x are frozen. There will hardly be any features added apart from bug-fixings.

For industry level application : 2.x because many libraries are yet to be ported ( example: mechanize, BeautifulSoup etc). Also Google App Engine does not support 3.x yet.

My suggestion would be to write code in 2.x, but make sure it can easily be ported. It's not that tough once you get the hang of py2to3 tool.

Ashwini Chaudhary
  • 244,495
  • 58
  • 464
  • 504
2

Just read this from python wiki. Short version: Python 2.x is the status quo, Python 3.x is the present and future of the language.

Personally I would install both, but for now use 2.x (2.7 or with some specific libraries 2.6) for developement, mainly due to better library support. And if the time comes, juping won't be too difficult, as the syntax changes aren't that substantial as Ashwini Chaudhary points. If you are just learning and don't need vast library support, go for the 3.x.

root
  • 76,608
  • 25
  • 108
  • 120
1

Most people are still using 2.x, even Django (one of the most popular web frameworks for Python) doesn't fully support Python 3 yet.

I would start with version 2.x. You'll have a lot less headaches when working with other libraries.

James Hush
  • 479
  • 1
  • 10
  • 26
  • [Bottle](http://bottlepy.org/docs/stable/) supports 2.5+ and 3.x. –  Oct 15 '12 at 20:04
  • 2
    Well, I hate those "most people". Python 3 is much better and for beginners libraries do not matter. – Oleh Prypin Oct 15 '12 at 20:06
  • @BlaXpirit what are the things improved in Python 3 ? – user1717079 Oct 15 '12 at 20:09
  • @user1717079 Text data handling is not fundamentally wrong (like in many other languages), for one. – Oleh Prypin Oct 15 '12 at 20:09
  • I agree with you BlaXpirit, and while it's true that for beginners libraries do not matter it depends what your end goal is. The main reason I started learning Python was to work with Django and I suspect a lot of people are in in similar boat. – James Hush Oct 15 '12 at 20:13