About 1,650,000 results
Open links in new tab
  1. Simple argparse example wanted: 1 argument, 3 results

    Sep 15, 2011 · The documentation for the argparse python module, while excellent I'm sure, is too much for my tiny beginner brain to grasp right now. All I want to do is "If arg is A, do this, if B do that, if

  2. 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?

  3. Conditional command line arguments in Python using argparse

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

  4. python - Very basic example of argparse? - Stack Overflow

    May 27, 2021 · Use it. argparse does a ton of useful things, and if you just take one short example and don't explore any further, you'll misuse it. Asking to use argparse without "a lot of code" to learn from …

  5. python - Setting options from environment variables when using …

    30 ConfigArgParse adds support for environment variables to argparse, so you can do things like:

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

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

  7. python - How to use argparse subparsers correctly? - Stack Overflow

    python test01.py A a1 -v 61 The "A" triggers the appropriate subparser, which would be defined to allow a positional argument and the -v option. Because argparse does not otherwise impose any …

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

    I am trying to pass a list as an argument to a command line program. Is there an argparse option to pass a list as option? parser.add_argument('-l', '--list', type=list, acti...

  9. python - argparse mutual exclusive group - Stack Overflow

    Changing the argparse code so you can create two groups like this was the easy part. Changing the usage formatting code required writing a custom HelpFormatter. In argparse, action groups don't …

  10. python - Why use argparse rather than optparse? - Stack Overflow

    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 …