New to Python - learn 2.7 or 3.2?

Return to General Discussion

New to Python - learn 2.7 or 3.2?

Postby 9littlebees » Thu Apr 26, 2012 8:58 am

Hello all,

I am new to programming and have decided on learning Python as my introduction. There is a brilliant book called "Invent Your Own Computer Games with Python" by Al Sweigart which I will be using to learn Python prior to jumping on to Panda3D.

The problem is that this book teaches Python 3, whilst it appears that Panda3D is still using Python 2.

I'm aware that there are some very strong opinions on 2 vs 3, but all I would like to know is:

If I learn Python 3, will it disadvantage me in any way when I eventually start using Panda3D?


Thanks in advance!
User avatar
9littlebees
 
Posts: 2
Joined: Thu Apr 26, 2012 8:49 am
Location: Bristol, UK

Postby powerpup118 » Thu Apr 26, 2012 12:58 pm

As far as I know, Panda3D has no support for Python 3.x

I would highly advise you use Python 2.x (latest 2.x release)

Panda3D 2.0 (last I heard) would be designed with Python 3 in mind, meaning it will probably be an optional feature.

Also, most libraries outside the standard Python distribution, as well as every Panda3D sample currently, is written for Python 2.x

I too, would like to begin using Python 3.x, however I believe it to be more fact instead of opinion, in the sense that most older libraries are only for Python 2.x currently.

People appear to be slowly making a transition to Python 3, and surely you could use Python 3, you would have to recompile Panda3D, and possibly fix any issues that come with an upgrade to Python 3.

In short: (as far as I'm aware) Panda3D only supports Python 2.x currently. It's advised you learn Python 2.x instead.

On a side note, Python 3 is still just as much Python as Python 2.x is, only some basic things have changed, it's fairly easy to convert code (or write python 2.x code with support for python 3.x), google this for more information.

I hope I've helped any,
~powerpup118
User avatar
powerpup118
 
Posts: 325
Joined: Sat Apr 17, 2010 11:59 pm

Postby 9littlebees » Sat Apr 28, 2012 3:09 am

powerpup118 wrote:I would highly advise you use Python 2.x (latest 2.x release)


Thanks, powerpup118, I've actually found at the back of the book I mentioned earlier, that the author has included an appendix that has Python 3 to Python 2 code differences, which means I can still follow in the book, making slight changes to the code where needed, such as:

Code: Select all
#Python 3 code:
my_name = input()


Compared to:

Code: Select all
#Python 2 code:
my_name = raw_input()


There are only a small number of differences, mainly because this book is at such a basic level, so I should be good.

powerpup118 wrote:it's fairly easy to convert code (or write python 2.x code with support for python 3.x), google this for more information.


Had a look and found some interesting articles. Looks like the transition will be well-supported whenever it eventually happens.

Thanks again!
User avatar
9littlebees
 
Posts: 2
Joined: Thu Apr 26, 2012 8:49 am
Location: Bristol, UK

Postby powerpup118 » Sat Apr 28, 2012 11:43 am

Hey,

There's also this page which shows the most basic features changed, in case you get stuck.

and this page which I find gives some valuable information on the future module.

And one of the biggest immediate failures IMO, is that print becomes a function instead of a statement.
Code: Select all
print "Hello world!", 1, 2, 3


vs.


Code: Select all
print("Hello world!", 1, 2, 3)


Have lots'o fun,
~powerpup118
User avatar
powerpup118
 
Posts: 325
Joined: Sat Apr 17, 2010 11:59 pm


Return to General Discussion

Who is online

Users browsing this forum: Bing [Bot] and 0 guests