I want to allow arbitrary command line arguments. If the user provides me with a command line that looks like this
myscript.py --a valueofa --b valueofb posar
Will argparse do what you want? It was recently added to the standard library. Specifically, you might want to look at this section of the documentation.