Recurse through directory (Python Style)

So i recently had an issue with the .svn directories that svn creates in each and every folder in a version controlled project. I figured i could delete the offending .svn directories by writing a small script. Here is what i ended up with:

from os.path import join, getsize
import os,shutil
for root, dirs, files in os.walk(‘<project path here >’):
for x in dirs:
if x == ‘.svn’:
print “removing ..” + root + “/” + x
shutil.rmtree(root + “/” + x

Hope it helps someone else 😉

Mysqdb for Python 2.5 under Windows

I recently  had to  port a linux based python project to a windows platform. The python project makes use of the sqlalchemy framework and thus required the MysqlDb module too.  Windows platform has python 2.5 and after searching for a while i realised that the python and mysql dudes seem to be taking their time to intergrate the 2. luckily some german dudes have a solution. If you ever have to use python with mysql under windows try this link.

http://biohackers.net/wikiattach/Python2(2e)5/attachments/MySQL-python.exe-1.2.1_p2.win32-py2.5.exe