Skip to content

Tag Archives: Python

Installing MatPlotLib on Snow Leopard with MacPorts

I have been trying to install the excellent MatPlotLib graphing module for the Python programming language on my iMac for a while now. Unlike most python module installations I’ve done the excellent python SetupTools (a.k.a easy_install) has not been up to the task.  So I ended up using MacPorts (version 1.8.1) to get MatPlotLib (version 0.99.1.1) installed on Snow [...]

Using SQLite in Python

Python has had support for SQLite built-in since version 2.5.
This is a very convenient pairing as SQLite is an excellent lightweight SQL implementation that I find very useful for a variety of tasks e.g. data mining.  Or any task involving manipulating complex data sets where I’d otherwise end up resorting to using a full blown [...]

Setting mac desktop wallpaper with Python

I have been playing with Python recently.
Here is a little script to change a mac’s desktop wallpaper to the file specified as the first argument of the script:

import subprocess,sys,os

# Raw apple script
Script = """/usr/bin/osascript<<END
tell application "Finder"
set desktop picture to POSIX file "%s"
end tell
END"""

# get the file name which is the first argument passed to this [...]

Ruby or Python: Round Two!

Yesterday in my post about web development frameworks, I mentioned I would be revisiting my previous post on whether to learn Python or Ruby.  So this post is a continuation of that earlier discussion.  I’m bringing up the topic of Python or Ruby again as I have been thinking about web frameworks since watching Cal [...]

Web Development Frameworks

When I created my first website back in 1998 it was purely static HTML that I created with Adobe’s DreamWeaver application.  Next I discovered dynamic websites built using php and MySQL databases, so my next few sites were all written in php and accessing a MySQL database for the content.  I have to confess that [...]