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 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 out Python's inbuilt title string method to…

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, showed me the pdb module and after using it for two secs I was loving it. Pdb is the python debugger. It's great because…

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. It made me think; why don't…

Python or PHP?

Recently I've been having interesting discussions with Ed and Cyril 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 or Python? What features made you choose one over the other? If…