Python, beyond the basics

Asked by At

I've gotten to grips with the basics of Python and I've got a small holiday which I want to use some of to learn a little more Python. The problem is that I have no idea what to learn or where to start. I'm primarily web development but in this case I don't know how much difference it will make.

11 Answers

e-satis On Best Solutions

Well, there are great ressources for advanced Python programming :

Here is a list of subjects you must master if you want to write "Python" on your resume :

They are what make Python such a cool language (with the standard library of course, that I keep discovering everyday).

William Keller On

I'd suggest writing a non-trivial webapp using either Django or Pylons, something that does some number crunching. No better way to learn a new language than commiting yourself to a problem and learning as you go!

akdom On

Something great to play around with, though not a project, is The Python Challenge. I've found it quite useful in improving my python skills, and it gives your brain a good workout at the same time.

Ryan Taylor On

I honestly loved the book Programming Python. It has a large assortment of small projects, most of which can be completed in an evening at a leisurely pace. They get you acquainted with most of the standard library and will likely hold your interest. Most importantly these small projects are actually useful in a "day to day" sense. The book pretty much only assumes you know and understand the bare essentials of Python as a language, rather than knowledge of it's huge API library.

I think you'll find it'll be well worth working through.

Russ On

Depending on exactly what you mean by "gotten to grips with the basics", I'd suggest reading through Dive Into Python and typing/executing all the chapter code, then get something like Programming Collective Intelligence and working through it - you'll learn python quite well, not to mention some quite excellent algorithms that'll come in handy to a web developer.

AdamKG On

Write a web app, likely in Django - the docs will teach you a lot of good Python style.

Use some of the popular libraries like Pygments or the Universal Feed Parser. Both of these make extremely useful functions, which are hard to get right, available in a well-documented API.

In general, I'd stay away from libs that aren't well documented - you'll bang your head on the wall trying to reverse-engineer them - and libraries that are wrappers around C libraries, if you don't have any C experience. I worked on wxPython code when I was still learning Python, which was my first language, and at the time it was little more than a wrapper around wxWidgets. That code was easily the ugliest I've ever written.

I didn't get that much out of Dive Into Python, except for the dynamic import chapter - that's not really well-documented elsewhere.

Sean On

People tend to say something along the lines of "The best way to learn is by doing" but I've always found that unless you're specifically learning a language to contribute to some project it's difficult to actually find little problems to tackle to keep yourself going.

A good solution to this is Project Euler, which has a list of various programming\mathematics challenges ranging from simple to quite brain-taxing. As an example, the first challenge is:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

And by problem #50 it's already getting a little tougher

Which prime, below one-million, can be written as the sum of the most consecutive primes

There are 208 in total, but I think some new ones get added here and there.

While I already knew python fairly well before starting Project Euler, I found that I learned some cool tricks purely through using the language so much. Good luck!

S.Lott On

I'll plug Building Skills in Python. Plus, if you want something more challenging, Building Skills in OO Design is a rather large and complex series of exercises.

user9282 On

The Python Cookbook is absolutely essential if you want to master idiomatic Python. Besides, that's the book that made me fall in love with the language.

Federico A. Ramponi On

Search "Alex Martelli", "Alex Martelli patterns" and "Thomas Wouters" on Google video. There's plenty of interesting talks on advanced Python, design patterns in Python, and so on.

AlexApps99 On

Start a project in a field you're passionate about and the learning will come naturally. Buying a book will always help you learn too.