I would recommend Python for a very large range of situations, and I would particularly recommend it for beginners.

For beginners I would point to three advantages:

  1. It has a relatively small set of legible English syntax, which is easy to learn.
  2. It has a robust exception model, so you often get to the source of problems immediately.
  3. Python eschews boilerplate, so you won't see phrases like public static void in the code that get glossed over in the accompanying text.

Sugar developers seem to agree with me; Python is one of the main programming languages available on the OLPC Laptop.

For more experienced developers, the main trade-off with Python is that though it runs slow-ish, Python has a reputation for being extremely productive to program with. As a hobbyist programmer, this means reward รท effort is high. That keep me programming rather than balking when complicated tasks come up. As a professional, this can give me a competitive edge.

Python is surprisingly good in a wide range of roles:

Learning Python

There are plenty of good resources for learning Python on the web.

Unfortunately the Python community is (at the time of writing, April 2010) split down the middle into Python 2.x and Python 3.x branches. Migration is slow, as Python 2 and Python 3 are incompatible. For learning Python, this means you have to choose whether to learn the latest Python 3 or the latest Python 2.

Beginners would do well to start with Python 3 now, as it is the new-and-improved version, improved in ways that help to eliminate many stumbling blocks. But you may find yourself having to learn how Python 2 differs to use some libraries or work with existing projects.

More experienced developers should probably jump into Python 2. It may be years before Python 3 is on an equal footing with Python 2, and you don't want to wait that long to be productive.

Learner's Resources

Improving your Python

Internalise the Zen of Python. Try

>>> import this

Read up on PEP8, Python's manual of style. No matter how strange you find the style it recommends at first, a lot of thought and experience has gone into these guidelines, and once you try them you should soon find your programs easier to read than ever before. Some projects require code/patches to be in strict PEP8 style.

Familiarise yourself with the packages you may not have otherwise come across in the standard library. Some of these provide more elegant solutions to the tasks you might face than what you'd come up with if you didn't know they existed. Some favourites include:

And some particular methods deserve mention

Python (last edited 2010-04-24 08:56:55 by DanPope)