def set_default ( self , section , option , default ) : if not self . parser . has_option ( section , option ) : self . parser . set ( section , option , default )
python argparse how to check if default is used
If the option did not exist create a default value .
def set_default(self, section, option,
                    default):
        """If the option did not exist, create a default value."""
        if not self.parser.has_option(section, option):
            self.parser.set(section, option, default)