Saturday, February 28, 2009

How I use Python

i love Python. i find it one of the most expressive programming languages i know. It's saved my bacon quite a number of times. for instance, when i generate test data for other applications i write, i generally generate the data (and usually the SQL to insert it into a database) with Python. also, when it comes to sorting data, it's much faster to write scripts to do basic data sorting (as an example, sorting out CDRs from Asterisk) in Python than it is in most languages. today was no exception. i had loads of numbers to send text messages to and i needed to weed out invalid destinations. for the first 50 or so, it was easy enough (but tiresome) to do by hand. when i started to look at just how many, i decided to write a script to help me sort out the numbers. abut 10 minutes later (mostly spent trying to create regular expressions that would do just what i wanted), i was done. and most of the program worked beautifully (well, there were some hiccups. i'm not perfect!)

No comments: