sawyl: (Default)
[personal profile] sawyl
I have a new favourite python module: optparse. Unsurprising, I suppose given my interests in writing command line utilities, but it's by far the best option parsing package I've found so far.

I particularly like its extensibility. I spent a happy few hours this morning writing a couple of routines to cleanly convert scientific values, e.g. 100k, into floating point values, and to change date stamps, 31/01/2008, in to epoch seconds. I've already pressed both routines into service, using them to simplify a couple of my Unitree maintenance programs.

I also greatly appreciate the ability to automatically generate help messages. Simply add in an overview of the program to the OptionParser constructor, add short descriptions to each of the options and, presto chango, -h generates a useful, pretty printed, help message. Ideal for user applications.

Profile

sawyl: (Default)
sawyl

August 2018

S M T W T F S
   123 4
5 6 7 8910 11
12131415161718
192021222324 25
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 4th, 2026 04:43 pm
Powered by Dreamwidth Studios