views:

8364

answers:

10

Hey guys. I am 12 years old and I have had a small amount of experience with BASIC. I am thinking about learning Python, but I’m not sure if I should learn the 2.6 version or the 3.0 version. I don’t really care about the support for libraries or anything along those lines quite yet. I was wondering if it is easier to code in 3.0 than 2.6. And is it more fun and productive?

I would also appreciate it if you could point me in the right direction for a simple yet complete tutorial that is easy to understand and possible teaches Object Oriented Programing. I don’t really care if it teaches OOP or not.

One more thing; if I do learn python, is it possible to easily compile a python source code file into a 'stand-alone' .exe file for Windows? I really liked that functionality in BASIC.

Thanks!!!!

+1  A: 

This is a duplicate, there's very similar question existing already

Learn python 3.0, there's less frustration-causing features in it. An official tutorial is not really pointed for beginners, but I think you can get along with it.

There's py2exe to produce executables. This has been also answered before.

Also I think the question about tutorials is answered here.

Cheery
A: 

Where is the similar question?

This is not an answer. Please update your question.
S.Lott
+3  A: 

Python 2 and Python 3 are very similar languages, but do differ in some important details. The most visible is probably the way the "print" statement works. It's different enough that the same script won't be able to run on both versions at the same time, but pick one and you'll be fine. Python 2.x will be around for years to come, but Python 3 is probably a good choice to start with today.

It is possible to compile a Python program into a standalone executable with tools such as py2exe but that's usually reserved for special distribution circumstances. I use dozens of Python scripts I've written every day and haven't compiled any of them to executables. Use of batch files, shell scripts, or just changing how Windows responds to certain file extensions, can make Python programs act just like .exe files.

Greg Hewgill
I think python 2.x will be around yet for around a decade, the adoption cycle can be terribly slow.
Cheery
+1  A: 

Python 3 is probably more consistent than 2.6 (well, that was mostly the point of the 3.x branche). OTHO,the differences are not that big (it's still the same language), and most tutorials, books, snippets and other material you'll find are for Python 2.x, so you may have to adapt them.

wrt/ tutorials, the official one is probably the best starting point. There are also quite a few resources linked from Python's website: http://wiki.python.org/moin/BeginnersGuide

And yes, there are utilities to build stand-alone Windows distributions of your Python programs. Py2exe comes to mind.

bruno desthuilliers
+2  A: 

At the moment, there is a much richer culture around the python 2.x series than python 3.0. This goes for extra modules, as well as for teaching material. You are better off with 2.x for now, even though the language features of 3.0 are presumably superior.

fivebells
+3  A: 

Thanks for all your swift feedback!!!! I think I'll go with version 2 and advance up to 3 when I need to and I think in a few years time there will be a ton of tutorials of how to get from 2 to 3.

I had a look at Py2Exe and it looks great!

As for the tutorial, I found a book called 'Snake Wrangling for Kids'. It looks good. There is a version for both python 2 and 3. It covers the basics, then moves on to so basic Object Orriented Programing.

Once again, thanks for all your feedback. I was expecting to have to wait weeks, or even months, to get a good answer. Every last one of your answers has been helpful, and I am excited about the Stack Overflow's community (this is my first question I have posted)

+2  A: 

A late answer, but since nobody has gotten this right:

Python 3 is a nicer and more consistent language, BUT, there is very limited third-party module support for it. This is likely to be true for at least a couple of years more. So, all major frameworks still run on Python 2, and will continue to do so for a significant time.

Therefore, if you learn Python today, you should learn Python 2, because that is the version you are going to end up actually using.

Lennart Regebro
I'm sorry, but every other answers says exactly that.
SilentGhost
Eh, no. Most of the recommend you to start with Python 3, so that's definitely NOT what they are saying.
Lennart Regebro
I guess you haven't read them then.
SilentGhost
The recommendations above are:"Learn python 3.0""Python 3 is probably more consistent than 2.6 ""Python 3 is probably a good choice to start with today."Only one said "You are better off with 2.x for now", citing "richer culture".Learn to read, OK?
Lennart Regebro
A: 

I would start with 2.6 -- simply because it's been around for a while, and there's lots of tutorials, sample code, and questions already answered.

btk
+1  A: 

I would say Python 3.x going by experience on trying to learn both at the same time. Because you are looking for something easy to program in and support for libraries are not something you care about yet.

My only problem with Python 3.x over Python 2.x is having to type more parenthesis. However, the core module breakdown is a bit easier to deal with in Python 3.x. Strings especially Unicode are better handled in 3.x as well.

I would recommend you look at the 2to3 information to see what kind of differences between 2.x and 3.x before you do any projects that involve external libraries. For the most part I found 3.x will go work with 2.x and you can do things like

try:
  import urllib.parse as urlparse
except ImportError:
  import urlparse #for 2.x

Learning the new one allows you to future-proof yourself anyway.

Archimedes Trajano
+1  A: 

I am a thirteen myself, and I believe that usually going with the newer versions are better, as more people will focus on the newest one, making more documentation, tutorials, modules, and programs for it, etc. However, Windows Vista and Ubuntu Karmic proved that wrong, so pick wisely, use other sources to make your descisions.

Galilsnap