Using the argparse output to call functions
问题 Currently my code looks like this. It allows me to parse multiple parameters my program script gets. Is there a different way that is closer to 'best practices'? I haven't seen code actually using the output of argparse , only how to set it up. def useArguments(): x = 0 while x <= 5: if x == 0: if args.getweather != None: getWeather(args.getweather) if x == 1: if args.post != None: post(args.post) if x == 2: if args.custompost != None: custompost(args.custompost) if x == 3: if args.list !=