Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Group info
Language: English
Group categories: Not categorized
More group info »
Active older topics
13 new of 13 - Jan 28 2011
2 new of 2 - Jan 16 2011
4 new of 4 - Jan 7 2011
2 new of 2 - Jan 7 2011
4 new of 4 - Dec 21 2010
4 new of 4 - Nov 15 2010
5 new of 5 - Nov 12 2010
2 new of 2 - Oct 22 2010
2 new of 2 - Oct 13 2010
4 new of 4 - Oct 8 2010
Discussions
View:  Topic list, Topic summary Topics 1 - 10 of 59  Older »

You cannot post messages because only members can post, and you are not currently a member.
Description: Mailing list for users of the argparse Python module.
 

Subparsers, set_defaults, and func 
  I'm trying to set up a command-line parser for basically three commands. Let's call the application "runner." The three commands are as follows: runner start runner stop runner install 1.2.3 As you can see, the "install" command takes an additional version-number argument. Here's what I have: parser = argparse.ArgumentParser()... more »
By Andrew Todd  - Mar 2 - 3 new of 3 messages    

argparse eating more than one '--' 
  I am converting some scripts from optparse to argparse, and discovered a problem. Argparse seems to be eating more double-dashes than it should, preventing the nesting of several commands on a cmdline, each of which take '--' to mean "all the rest of the cmdline are positionals, not options". Consider this toy reimplementation of... more »
By Benjamin  - Feb 11 - 2 new of 2 messages    

Defining argument group for help and version 
  Hello, Sometimes its helpful to separate the help and version options (which provide script information) from those used in running the script normally. I can create a custom argument group that includes the help and version options as follows: p = argparse.ArgumentParser(descri ption=script_description,... more »
By Steve  - Dec 2 2011 - 2 new of 2 messages    

multiple usage strings 
  Hello, Is there a recommended way to leverage argparse to define multiple usage strings (for example, to illustrated mutually exclusive use cases). E.g.: myscript.py [-h] [--version] myscript.py [-f FOO] infile [infile ...] The best I've come up with so far is to create sets of specifications for add_parser. First, create a parser for each set just to get the... more »
By Steve  - Dec 2 2011 - 2 new of 2 messages    

custom python shell (cmd + argparse) 
  I want to make a custom interactive shell. I figured using the cmd module might be most convenient. basically make a new class inheriting cmd and then add commands using the do_cmd convention. Because this is a shell I will override the invalid argument default exit behavior of argparse so that instead of exiting I get the shell... more »
By abhishek bhat  - Sep 21 2011 - 3 new of 3 messages    

mutually exclusive groups + arguments 
  Guys, after looking for this a lot, I had to come here and ask. Even checked examples at [link] I want this behaviour: ( -f FILENAME | -i IP -u USER -p PASSWORD ) You see? If it's -f, then just a filename, otherwise if -i, need -u... more »
By Eduardo Bacchi Kienetz  - Jun 28 2011 - 3 new of 3 messages    

Action not invoked for default value 
  Hi there, Have been playing with a custom Action that automatically sets logging verbosity based on a command line argument. Something that surprised me was that if a default value is specified and the user does not specify the flag then the action is never called. In my case, this meant that the default logging level was never set.... more »
By Martin Pengelly-Phillips  - Jun 10 2011 - 2 new of 2 messages    

Nested subparsers? 
  Hi Steven, How can I use the argparse in this way: ... NOTE: each cmd{#} defined as a subparser with its unique set of parameters. It's close to the behavior of "svn commit" for example with an addition of a mandatory parameter before any subparser, this parameter determines which subparser to call, say:... more »
By MaxB  - Jun 11 2011 - 2 new of 2 messages    

how to tell parse_known_args to not parse all known args 
  Hi all, I guess my question is a bit lame, but here's the problem: I have a bunch submodules of a package that work as standalone scripts, each creating its own ArgumentParser. Now, I also have a frontend script that takes as input the name of a script. The frontend parses the command line with parse_known_args, imports the requested... more »
By Giovanni Luca Ciampaglia  - Mar 27 2011 - 4 new of 4 messages    

unable to create "subgroups" under mutually exclusive group 
  Dear developer, I am new to Python and have a question: is there any way in argparse to create "subgroups" under mutually exclusive group? For example, I would like to group four options a, b, c, and d into two mutually exclusive subgroups ("a","b") and ("c","d"). And within each group, I hope both of the arguments are "required", for example, if "--b"... more »
By Liang Wang  - Mar 9 2011 - 2 new of 2 messages    

1 - 10 of 59   « Newer | Older »

XML       Send email to this group: argparse-users@googlegroups.com