[code.view]

[top] / python / PyMOTW / argparse / argparse_parent_with_group.py

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2010 Doug Hellmann.  All rights reserved.
     #
     """Parent with shared options
     """
     #end_pymotw_header
     
     import argparse
     
     parser = argparse.ArgumentParser(add_help=False)
     
     group = parser.add_argument_group('authentication')
     
     group.add_argument('--user', action="store")
     group.add_argument('--password', action="store")
     

[top] / python / PyMOTW / argparse / argparse_parent_with_group.py

contact | logmethods.com