[Tutor] passing named arguments through command line
Danny Yoo
dyoo at hashcollision.org
Thu Oct 30 19:24:35 CET 2014
On Thu Oct 30 2014 at 7:58:32 AM Lukas Nemec <lu.nemec at gmail.com> wrote:
> Hello,
>
> take a look at argparse library.
>
Hi Robert,
As Lukas mentions, it sounds like you're looking for a "flag parsing"
library. A flag parsing library reads a set of key/value pairs that are
encoded in sys.argv, so they let command-line programs provide variable
values through the use of these flags.
There are a few of these flag libraries in Python due to Python's long
history. The one that Lukas recommends, 'argparse', is probably the one
you want to use.
You can find documentation for argparse at:
https://docs.python.org/2/howto/argparse.html#id1
https://docs.python.org/2/library/argparse.html
Good luck!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20141030/e1bd9381/attachment.html>
More information about the Tutor
mailing list