(The following text refers to a future version of this page.)
This page holds some pieces of code that I've written, and some that I've gathered from elswehere. Some of the code I've written here is pretty trivial, but it might still save you a few minutes over writing it yourself. I've also gathered together a few things that took me longer to find than I thought they should have, and labeled them in a way that I hope will get the search engines' attention enough that the next poor soul will have an easier time.
getoptxSubstitute for getopts that accepts long option names,
written by Grigoriy Strokin. It is no longer available
where I originally found it, but fortunately declares itself to be
in the public domain.
Very primitive, and has a very limited understanding of what an s-expression is, but it works for what I've been using it for (reading Penn treebank data). You should also consider whether readlisp.py might better fit your needs.
Shell scripting utility. It assumes that the import is sorted, and takes the first n fields as the key fields. You can ask for the sum, maximum, complete list, and so on of each group. I'm still looking for a better version of this — A speedy C version would be very nice. For now, this works.