Re: Pythonically extract data from a list of tuples (getopt)
You could use http://docs.python.org/lib/module-optparse.html -- http://mail.python.org/mailman/listinfo/python-list
Pythonically extract data from a list of tuples (getopt)
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 a