News for hackers. Stuff that matters.
Re:Opster: Pythonic option parsing by mr_dbr on Tuesday September 15, 2009 @05:15PM (#824769)
What about something like..

    defaults = load_stored_config_to_dict('example.conf')
    
    parser.add_option(
        "-q",
        "--quiet",
        action="store_false",
        dest="verbose",
        default=defaults['quiet'],
        help="don't print status messages to stdout")
Re:Opster: Pythonic option parsing by danohuiginn on Wednesday September 16, 2009 @07:35AM (#825593)
yeah, that's not a bad way of doing it. I ended up with something more convoluted, partly because of the catch-22 situation of wanting to be able to specify the config file from the command-line.

More discussion of this problem: http://deadbraincells.org/configopt/docs/configopt.html http://wiki.python.org/moin/ConfigParserShootout#ConfigParse...