Passing user's args to Python Posted on 2019-01-31 Sample code for passing user’s args to Python program 12345678910import argparseif __name__ == '__main__': parser = argparse.ArgumentParser(description='') parser.add_argument('-arg1', type=str, nargs=None) parser.add_argument('-arg2', type=str, nargs=None) args = parser.parse_args() a = args.arg1 b = args.arg2 main(a, b)