I noticed that the Python 2.7 documentation includes yet another command-line parsing module. In addition to getopt
and optparse
we now have argparse
.
Why has yet another command-line parsing module been created? Why should I use it instead of optparse
? Are there new features that I should know about?
As of python 2.7
, optparse
is deprecated, and will hopefully go away in the future.
argparse
is better for all the reasons listed on its original page (https://code.google.com/archive/p/argparse/):
+
and /
More information is also in PEP 389, which is the vehicle by which argparse
made it into the standard library.