Python 2 or 3 ?

This is the place for queries that don't fit in any of the other categories.

Python 2 or 3 ?

Postby Simmo » Sat Apr 05, 2014 2:11 pm

Hello everyone, this is my first post and doubtless it's a question which has been asked many times on here ;-)

I am just setting out on my 'learning Python' journey and there seem to be mixed opinions as to which version I should be learning. I have been 'messing around' on and off with Python and have now bought myself a book named 'Python Programming For The Absolute Beginner - Third Edition'. Python 3.1 is the version used in the examples in the book. My first goal would be to become good enough to be able to create 2D style games (which Is a very long way away at the moment of course.) Having checked on various sites online I'm now left confused as to whether I should switch to learning Python 3.1 as per the examples in the book or continue with the version I currently have on my PC. I'm currently running Python 2.76 on Windows XP Home Edition. It would seem to make sense to learn the more up to date version but then I read of various problems with doing so when it comes to things such as Pygame for instance. I have already encountered the print ".." and print("..") differences and l was left thinking that as I'm taking my first steps into learning Python it would obviously make sense to set off on the right path now as opposed to having to change paths in a few months time.

Could anyone advise accordingly please ?

Thanks very much.

Last edited by Mekire on Sat Apr 05, 2014 2:12 pm, edited 1 time in total.
Reason: First post lock.
Posts: 1
Joined: Sat Apr 05, 2014 1:34 pm

Re: Python 2 or 3 ?

Postby Mekire » Sat Apr 05, 2014 2:14 pm

Go ahead and learn python 3. There is no real problem with Pygame and Python 3. Eventually you will learn what the critical differences are. I tend to write all my Pygame code to be mutually compatible if it is at all possible (which is most of the time).

New Users, Read This
  • Use code tags when posting code.
  • Include any errors with your post (in code tags).
  • Describe your problem; not your chosen solution.
  • Make examples the minimum length to demonstrate your issue.
User avatar
Posts: 1710
Joined: Thu Feb 07, 2013 11:33 pm
Location: Tucson, Arizona

Re: Python 2 or 3 ?

Postby metulburr » Sat Apr 05, 2014 2:23 pm

Python2.x isnt going anywhere for a long time. Not all 3rd party modules have been ported yet. Pygame does work with python3.x.

It doesnt have to be one way or the other: for example i mostly use python3.x, but for libraries that have not yet been ported, i use python2.x. But i always try to code with both in mind. There are very slight differences between the two versions anyways
we will be moving to on October 1 2016
more details here
User avatar
Posts: 2242
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 4 guests