[Tutor] Python Saved the Day

Wayne Werner waynejwerner at gmail.com
Sun Dec 4 15:24:56 CET 2011


On Sun, Dec 4, 2011 at 2:51 AM, wesley chun <wescpy at gmail.com> wrote:

>
> Does anyone else have similar stories? (I think I may be biased as I use
> Python for everything, trouble or otherwise, so I can't tell the difference
> anymore!)
>

I work in a .NET shop, and the last project I worked on required us to
re-implement a report system that was doing a variety of complicated things
(due to the nature of the older tech used).

This required us to run and re-run our version to compare against the old,
many many times. My teammate started doing the comparisons by hand using a
merge tool... after watching that process for about 5 minutes, I went ahead
and wrote a quick Python script (<30 lines) that would compare the two
reports. I ended out extending the script to a full blown text-program with
some nice menus and things, and all told probably spent less than an hour
or two writing scripts that saved... probably at least 10 man hours of
comparisons, probably much more than that when you factor in the exhaustion
from doing such a menial task.

The tools that I found extremely useful:

1) Modules - I used re and csv fairly heavily. One piece of the report was
textual and the re module allowed me to easily parse out the important
information from each report. The other one was a spreadsheet, so csv
readers were quite nice

2) List comprehensions/generator expressions - mutating the data from text
to something that I could really use took two or three passes. Being able
to express this in two or three lines was invaluable

3) Syntax (including dynamic binding) - the terse syntax allowed me to
express what I wanted to express, with no extra "stuff" (e.g. End With)

Personally I wish I was in your shoes (using it for everything), but I'm a
huge Pythonista so that should hardly be a surprise ;) (and definitely
wouldn't be a surprise for any of my former classmates. I was quite the
evangelist... and still am)
-Wayne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111204/eb8d0494/attachment-0001.html>


More information about the Tutor mailing list