How to add command line arguments with flags in Python3?
The python 3 library includes 3 modules for parsing the command line thus nothing extra to add to your setup. The one you should use is argparse import argparse parser = argparse.ArgumentParser() #-db DATABASE -u USERNAME -p PASSWORD -size 20 parser.add_argument(“-db”, “–hostname”, help=”Database name”) parser.add_argument(“-u”, “–username”, help=”User name”) parser.add_argument(“-p”, “–password”, help=”Password”) parser.add_argument(“-size”, “–size”, help=”Size”, type=int) … Read more