def main():
    """
        Main method
    """

    # Options
    global args
    parser = argparse.ArgumentParser()
    parser.add_argument("-n", "--min_word_length", type=int,
                        help="Minimum length for each word", default=3)
    parser.add_argument("-x", "--max_word_length", type=int,
                        help="Maximum length for each word", default=8)
    parser.add_argument("-i", "--max_int_value", type=int,
                        help="Maximum value for the integer", default=1000)
    parser.add_argument("-e", "--number_of_elements", type=int,
                        help="Number of elements in the password (ie. 4 = 3 words + 1 integer)", default=4)
    parser.add_argument("-s", "--no_special_characters",
                        action='store_true', help="Do not use special characters")
    args = parser.parse_args()

    # Print a password
    print(pw(min_word_length=args.min_word_length,
             max_word_length=args.max_word_length,
             max_int_value=args.max_int_value,
             number_of_elements=args.number_of_elements,
             no_special_characters=args.no_special_characters))
def main ( ) : global args parser = argparse . ArgumentParser ( ) parser . add_argument ( "-n" , "--min_word_length" , type = int , help = "Minimum length for each word" , default = 3 ) parser . add_argument ( "-x" , "--max_word_length" , type = int , help = "Maximum length for each word" , default = 8 ) parser . add_argument ( "-i" , "--max_int_value" , type = int , help = "Maximum value for the integer" , default = 1000 ) parser . add_argument ( "-e" , "--number_of_elements" , type = int , help = "Number of elements in the password (ie. 4 = 3 words + 1 integer)" , default = 4 ) parser . add_argument ( "-s" , "--no_special_characters" , action = 'store_true' , help = "Do not use special characters" ) args = parser . parse_args ( ) print ( pw ( min_word_length = args . min_word_length , max_word_length = args . max_word_length , max_int_value = args . max_int_value , number_of_elements = args . number_of_elements , no_special_characters = args . no_special_characters ) )
Main method