Skip to content

Monthly Archives: June 2009

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 [...]

Window Managment on Large Monitors

I have had a 24″ monitor at work for a while and recently bought myself a 24″ for use as a second monitor on my 17″ iMac at home.  I really enjoy the extra screen real estate that a large monitor with a resolution of 1920×1200 provides.  However most applications don’t really make good use [...]

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 [...]