That Traceback is not error produced by running the code in the original post. Anyway, there is no SantBrk defined in the above code.
import argparse parser = argparse.ArgumentParser(description='MOM.') parser.add_argument('-b', '--brknum',type=str, dest='brokeName', action='store', default='brk01', help='un num de broker') args = parser.parse_args() print(args.brokeName)running without any command line arguments return the default value
Output:brk01
>>>
Now I noticed that in the Namespace output you have SantBrK with capital K