Pythonically extract data from a list of tuples (getopt)

2008-04-23 Thread Mark Reed
So the return value from getopt.getopt() is a list of tuples, e.g. import getopt opts = getopt.getopt('-a 1 -b 2 -a 3'.split(), 'a:b:')[0]; opts [('-a', '1'), ('-b', '2'), ('-a', '3')] what's the idiomatic way of using this result? I can think of several possibilities. For options not

Tidy module?

2008-04-17 Thread Mark Reed
Is there an easy_installable egg with an interface to libtidy? I found µTidy, but it looks like an inactive project, with no updates since 2004, so I'm skeptical of its reliability. I found mxTidy, but it's only available as part of some larger distribution, and I don't want to replace my Python