my python doodles

Archive for June 2011

Some scripts that actually work!

leave a comment »


I haven’t looked at this blog in over 2 years, but yesterday I was talking to a friend who had learned the basics of Python, and was looking for a project to work on in order to learn more. I remembered this old blog and promised to send her the link. So today I looked at some of my scripts and I was surprised – they’re nowhere near as good as I remembered. Untidy code, meaningless variable names, and I often needlessly used libraries like Numpy and Scipy. Libraries are great, but often when you upgrade to a new version of Python the library stops working, and it can be a real hassle keeping everything up to date.

Also, what was I thinking, pasting code into a WordPress blog? It’s unreadable and it messes up the formatting. Gah.

Anyway I ended up spending a pleasurable afternoon putting together a few simple scripts that actually work, and might be fun for other people to hack with too.

A simple example of animation using Python and TKinter

Endlessly bouncing ball – another Python and TKinter animation example

The crappiest video game ever made: a ball bounces across the screen and if you click the ball, you win! Demonstrates a Python TKinter animation that registers mouse-clicks.

I couldn’t resist adding my version Conway’s Game of Life, even though it won’t work unless you have Numpy installed.

Written by KM

June 25, 2011 at 4:37 pm

Posted in Uncategorized

Design a site like this with WordPress.com
Get started