Sunday, September 30, 2007

Python Rocks

I did my program for my compling class. Hope it works for my "partner". His job is to run it and find the "glaring errors" in my regular expressions and such. Then he'll send those back to me and I fix them. I do the same for him.

I don't know what OS he uses, so I just sent him the raw sourcefiles and told him to run them by typing python It's probably the easiest way. I did have the fun of actually setting it up as modules - there's the main program which calls out to the handler module, which uses a data module full of lists and dicts and sets oh my!

I got to really put sets and the re module to the test. I've not used re much - actually, I've avoided it like the plague. So - yes, it works. But I don't like it much. I remember the comment by Jamie Zawicki (often attributed to the effbot who used it as a sig):
Some people, when confronted with a problem, think “I know,
I'll use regular expressions.” Now they have two problems.

I'm just really really glad I got to use Python for this class.

The workshop went well. I should have asked people how far along they were - turns out some of them had taken the advice, and pointers to tutorials, and really run with it. But, I think some others were pretty novice, and got something out of the early part of the session. We divided it up: I covered syntax, loops, if/elif/else, strings, and did some hands-on work, then turned it over to Alex who covered regular expressions with re, and lists and dicts.

It'll be interesting to see how the class is on Tuesday. Unfortunately, I'm really behind on my reading for my philosophy of science class so I get to do that tomorrow morning. Then, back to programming, and then, my assignment for my HCI class and then more reading.

Wow. I feel good - but swamped.

1 comment:

osg said...

Congrats! Sounds like success. :) Speaking of homework, I am off to do my Chinese assignment.