Install lxml on OSX

Thanks to this post on lxml from Ian Bicking [http://blog.ianbicking.org/2008/12/10/lxml-an-underappreciated-web-scraping-library/] I've found the following command is all that's required to install lxml on Mac OSX: STATIC_DEPS=true easy_install 'lxml>=2.2beta4'…

Python 3.0 Released

So Python 3.0 is out [http://www.python.org/download/releases/3.0/] - here's the list of what's new [http://docs.python.org/3.0/whatsnew/3.0.html]. There's a lot in there and it specifically say it's incomplete…

FAIL of the week: uTidyLib unicode error

This week I’ve been having fun using uTidyLib, a python wrapper for HTML tidy. All was working swimmingly until I hooked it up to a custom form validation function in Django. The Python process on my mac kept crashing and I was wondering what the cause was since it…

Titlecase.py: Titlecase in python

John Gruber recently published a perl script to convert strings into title case [http://daringfireball.net/2008/05/title_case] avoiding capitalizing small words based on rules from the New York Times Manual of style as well as catering for several special cases. Before porting the perl script I tried…

Python: Debugging with PDB

Debugging anything can be a real pain in the backside. However with the right tools (think firebug) it actually can become enjoyable. The other day Rob [http://www.siudesign.co.uk/], showed me the pdb module [http://docs.python.org/lib/module-pdb.html] and after using it for two secs…

pwdn: show last n dirs of current directory

I've been playing around with some scripts of late to automate delivery of my various scripts and aliases to servers and in doing so I was looking back at the code I am calling to display the last two directories in my bash prompt [https://muffinresearch.co.uk/…

Python or PHP?

Recently I've been having interesting discussions with Ed [http://ejeliot.com] and Cyril [http://cyril.doussin.name/thoughts/] regarding some of the differences between PHP and Python and what makes each one special. So I'm interested to know what are the things you love about PHP…