About 10,600,000 results
Open links in new tab
  1. What's the best way to parse command line arguments?

    What's the easiest, tersest, and most flexible method or library for parsing Python command line arguments?

  2. python - How can I pass a list as a command-line argument with …

    Don't use quotes on the command line 1 Don't use type=list, as it will return a list of lists This happens because under the hood argparse uses the value of type to coerce each individual given argument …

  3. How to handle variable number of arguments (nargs='*')

    The relevant Python bug is Issue 15112. argparse: nargs='*' positional argument doesn't accept any items if preceded by an option and another positional When argparse parses ['1', '2', '--spam', '8', '8', …

  4. Conditional command line arguments in Python using argparse

    Conditional command line arguments in Python using argparse Asked 13 years, 9 months ago Modified 3 years, 2 months ago Viewed 41k times

  5. python - Arguments that are dependent on other arguments with …

    Arguments that are dependent on other arguments with Argparse Asked 10 years, 11 months ago Modified 5 years, 11 months ago Viewed 53k times

  6. python - Parsing boolean values with argparse - Stack Overflow

    @AnatolyAlekseev, argparse developers are fully aware that some users try to handle strings like "True" or "False" as booleans, but have rejected proposals to redefine the basic Python bool function. …

  7. python argparse: unrecognized arguments - Stack Overflow

    When I run parsePlotSens.py -s bw hehe, it says that hehe is an unrecognized argument. However, if I run parsePlotSens.py hehe -s bw, it's OK. Ideally, I would like it work for both cases. Any ti...

  8. python - argparse mutual exclusive group - Stack Overflow

    possible duplicate of How to make python argparse mutually exclusive group arguments without prefix?

  9. Python argparse: "unrecognized arguments" - Stack Overflow

    Jul 17, 2015 · Python argparse: "unrecognized arguments" Asked 10 years, 4 months ago Modified 10 years, 4 months ago Viewed 80k times

  10. Make argparse treat dashes and underscore identically

    Nov 28, 2018 · An alternative is to subclass argparse.ArgumentParser to make the matching invariant to replacing dashes by underscore. This requires a little bit of fiddling, as both …