Getting started with Python
The following is how I’d recommend getting started programming in Python:
- The Python Tutorial .
First off work your way through the official Python tutorial, its very comprehensive and covers all the language features and also has a quick tour of the modules available in the standard library. - Code Like a Pythonista: Idiomatic Python
Next I’d highly recommend reading the ‘Code Like a Pythonista‘ article is its entirety, its very useful for learning about the Pythonic way of thinking. - The Python Style Guide.
Next read the Python Style Guide (know as PEP-8), which will teach you about the general python coding style which depending on the languages you’ve used before could be quite a different style. - The Python Challenge.
Now try the Python challenge, this will push your new Python skills and riddle solving abilites. If you get stuck the official forums are helpful, I found I got stuck on the riddles more than the programming. Once you’ve solved each of the challenges I’d strongly recommend going and checking out the submitted solutions to that challenges. I found this a incredibly helpful learning experience, as by looking at the solutions I learned the pythonic way to solve the problems. Note: you can’t access these solutions till you’ve solved them yourself. - ‘Learn Python the Hard Way’ or ‘Dive into Python’.
For gaining further knowledge there are several ebooks available online for free: the first is Learn Python the Hard Way and there is also the dated Dive into Python. I’ve not read Learn Python the Hard Way but I’ve heard good reviews from several people.
For getting help with Python programming I’d recommend:
- Stack Overflow.
Stack Overflow is a collaborative quesion and answers site for programmers and has a very active python community. It is highly recommended to searching to see if your question has been asked already before posting a question. - #python on irc.freenode.net.
Visiting the #python IRC channel on irc.freenode.net is also a very good way to get help with Python questions. You can find our more about the various Python IRC channels here. Note: You’ll need an IRC client like X-Chat (Linux & Windows) or Colloquy (Mac).
Here are some tools I’d recommending picking up:
- Package installer – PIP or easy_install.
PIP is the current Python package installer of choice and lets you easily download and install Python from various sources such as the official Python package repository – PyPi and SourceForge. I found that PIP makes installing new Python packages trivial 99% of the time, the other 1% of the time you’ll need to build the packages locally which is more involved. Note: Windows users may be better off sticking to the older easy_install tool instead of PIP. - Enhanced command line – iPython or bPython.
iPython is an enhanced command line environment for Python that I’d highly recommend over the basic command line interpreter. You can find several different of video tutorials for iPython listed here. I am told that bPython is another enhanced command line that is worth checking out too. - Code analyser – PyLint or pyflakes.
PyLint is a python version of the Lint C/C++ static code analysis tool which will analyse your Python code and give you useful feedback on your code as well as a score out of 10. PyLint will also check your code adheres to the official Python Style Guide which I found very useful for learning the Python coding style. Alternatively pyflakes has also been recommended for static analysis of python code.
I’d be interested in hearing of any other resources you found useful to help you get started with python.
You can leave a response, or trackback from your own site.







I would really recommend pyflakes instead of pylint. pylint is very powerful but a bitch to configure.
I would also recommend “Learning Python the Hard Way” instead of “Dive into Python” (personal preference but the Python 2 version of “Dive into Python” is very old).
There is also an issue with pip for Windows users – to install packages with C extensions you must have a compiler installed. easy_install (from Distribute of course) will install pre-built binary packages.
re: Michael.
Thank you for taking the time to comment and provide feedback. To be honest I’ve always just used PyLint with its default settings, so configuration has never really been an issue for me but I’ll take a look at pyflakes as it sounds interesting. I’ve updated the post with your tips about ‘Learn Python the Hard Way’ and easy_install.
I can’t imagine coding python without a copy of beazley at my elbow
Thank you so much Daniel
Wow. Terrific list, very useful. Thanks.
bpython I think is also worth a look. I like it even better than iPython.
Add bpython and a simple web framework (flask or webpy) to your list. Remove ‘Dive into python’ as I find that book controversial as regard to a good beginners book (see first example in the book, which is terrible!).
To learn python in a classroom: Google’s Python Class with a real teacher, exercises and download material.
It rocks!
Thanks for all the feedback I’ve updated the post.
There’s the newer “Dive Into Python 3″ (http://diveintopython3.org/) so I wouldn’t describe it as dated. I have not really looked at it with a beginner’s book-perspective but there is definitely some great material in there, e.g. the chapter on http web services.
I second the opinion that Beazley’s “Essential Reference” is almost a must-have.
I have Beazley’s book its a good one, I’m starting to think a follow up post on Python books would be worthwhile.
How about adding this: http://beginpython.com
Exercises for basic python programming.
MIT’s free Open Courseware for “Introduction to Computer Science and Programming” is all done in Python. It may be too basic for experienced folks, but for baby hackers is a great intro to both Python and to basic programming paradigms.
I recommend Python Koans highly – https://github.com/gregmalcolm/python_koans/wiki
You learn all the features of the language by fixing unit tests.
Cheers Daniel. Your article and the links are helping me escape my novice-coder-hell.