Showing posts with label python. Show all posts
Showing posts with label python. Show all posts
Thursday, 26 February 2009
More Google ...
Seems like I'm going Google crazy these days, but as part of my day job I've been looking at Google App Engine this week. It's certainly a very rapid development tool and I wouldn't hesitate to use it for personal projects ... but at the same time it feels a bit lashed together to me. It uses Python 2.5.2, so no complaints there, but why use Django 0.96.1 when Django 1.0 was released in September last year? Anyway, I'm just nit-picking to be honest - it's another great tool from Google and the benefits far outweigh the drawbacks.
Wednesday, 21 January 2009
Python Gotcha
Spent ages last night trying to track down a bug in Python. I wanted to do something you don’t often need to do in Python – initialise a two-dimensional list – which I did like this ...
>>> a = [[None] * 4] * 2
>>> a
[[None, None, None, None], [None, None, None, None]]Turns out I should have used a list comprehension to do it ...>>> a = [[None] * 4 for i in range(2)]
>>> a
[[None, None, None, None], [None, None, None, None]]They both look the same, but they are not! It’s fairly obvious when you think about it, but trying to track this down in a reasonably complex piece of code wasn’t easy ...
Saturday, 19 April 2008
Playing with Pygame
Over the past few weeks I've been writing a 'game' of sorts using Python and Pygame - it's still in the very early stages at present and is less of a game and more of a toy/proof of concept. Nonetheless, I'm fairly pleased with the results so far and since this is the first time I've tried doing any pixel art (or any computer art of any description) I think it looks okay ...

Obviously the player sprite is still a work in progress (although he does have a certain charm!)
For dev tools I'm using Eclipse + PyDev for coding and Gimp for the images.

Obviously the player sprite is still a work in progress (although he does have a certain charm!)
For dev tools I'm using Eclipse + PyDev for coding and Gimp for the images.
Subscribe to:
Posts (Atom)
