Top "Argparse" questions

A Python module for implementing command-line interfaces

Python argparse: Is there a way to specify a range in nargs?

I have an optional argument that supports a list of arguments itself. I mean, it should support: -f 1 2 -f 1 2 3 but …

python argparse
argparse with required subcommands

With python's argparse, how do I make a subcommand a required argument? I want to do this because I want …

python argparse
No module named pathlib2

I've been working on getting Google Assistant working on my Raspberry Pi 3. It is working but I'm having problems getting …

python json argparse google-assistant-sdk pathlib
How to pass on argparse argument to function as kwargs?

I have a class defined as follows class M(object): def __init__(self, **kwargs): ...do_something and I have the …

python python-2.7 arguments argparse
python argparse - either both optional arguments or else neither one

I have a program that uses a default name and password. I'm using argparse to allow the user to specify …

python command-line-arguments argparse
Python: argparse optional arguments without dashes

I would like to have the following syntax: python utility.py file1 FILE1 file2 FILE2 where file1 and file2 are …

python argparse optional-arguments
Restricting values of command line options

How do I restrict the values of the argparse options? In the below code sau option should only accept a …

python command-line-arguments argparse
Python argparse argument with quotes

Is there any way I can tell argparse to not eat quotation marks? For example, When I give an argument …

python argparse optparse
Python argparse, provide different arguments based on parent argument value

here is what i would like to do : A command that looks like git command behavior. You don't get the …

python dynamic argparse subparsers
How can I install argparse in Python 3.1?

I am trying to get argparse to install in Python 3.1, but I get a UnicodeDecodeError out of setup.py when …

python easy-install argparse python-3.1