Taming the Python

I’ve been learning some Python recently. I have to say, I rather like it: it’s very flexible, very quick to develop, and very powerful. It’s also object-oriented, which is a real plus in my book (although you don’t have to use the objected oriented features, for example if you’re writing a small-ish script). It’s very useful for quick automation scripts – you get the power and flexibility of Python, without the bloat of a high-level language such as Java or the … um … ‘quirkiness’ of shell scripting 😉 And let’s not mention perl or PHP… (I’m not trying to start a flame war, honest!)

I had to write a script the other day at work which epitomises the usefulness of shell scripts: we use a ‘continuous integration’ build system called Cruise Control. This generates a new directory each time it makes a build. What I wanted to do was have all but the ten most recent builds cleaned out. Given that I didn’t know anything about python before I started, I managed to knock something up in about half an hour. The documentation is pretty extensive as well! And there’s a good beginner’s tutorial.

Check out my new online project:

All in all, it’s a subject which I hope to write more about, perhaps post up a few tutorials, examples, that sort of thing.

One thought on “Taming the Python

Leave a Reply

Your email address will not be published. Required fields are marked *