Category : argparse

parser = argparse.ArgumentParser() parser.add_argument("-f","–first", action="store_true", default=False, help = "Execute first option") parser.add_argument("-s","–second", action="store_true",default=False, help = "Execute second option") parser.add_argument("-t","–third", action="store_true", default=False, help = "Execute third option") args = parser.parse_args() if args.first: print("i am the 1st option") elif args.second: print("i am the 2nd option") elif args.third: print("i am the last option") I am trying to open ..

Read more