Ahh ! for argparse
Jul 1st, 2009 by harijay
Its been a while since I blogged . Just a lot happening on the crystallography side of things to allow me the time to blog.
I have also been coding a lot lately and have gotten started with some GUI writing in wxpython.
This post is about trying to get back into the groove by telling you about argparse . Having talked about optparse and command line parsing , I heard about argparse thanks to a talk that I caught by clicking a link on the Pycon2009 master schedule . This link has all the Pycon 2009 slides and video links in one place – a great resource.
For those interested in argparse check out the “Plenary Evening session ” on Sunday Mar 29th 1.20 pm at PyCon2009 where Steven Bethard talks about argparse.
The most important difference between argparse and optparse is that argparse provides better handling for positional arguments in addition to optional arguments . Argparse also provides automatically generated useage information and takes care of handling cases like when the user forgets to provide any arguments and prints the help information by default.
The key differences are summarized in the excellent documentation at this URL , so I will not rehash it . But I have happily switched over to argparse from optparse and hope argparse becomes part of the python standard libraries soon.
For some code examples check out my github repository especially the script maskconvert.py
is your wxpython hacking in any way related to DataQ?
Sort of , I am trying to write a GUI for the grid making collection of scripts for the robot
Hi, I saw that you left a note on Evernote’s blog last january regarding font issues while transferring your notebooks from google notebook to evernote. Did you find a solution? If you did, would you send me an e-mail (did not find your email adress on the blog). I also posted a comment on their blog regarding that issue, but it never got published.
All the font issues are now sorted . I could import all my notebooks without any encoding errors into evernote from an Atom XML file exported from google using their new ( as of June 2009) importer