I have the following code which attempts to get the DUT VID from the invoked command line:
parser = argparse.ArgumentParser(description='A Test',
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
group.add_argument("--vid",
type=int,
help="vid of DUT")
options = parser.parse_args()
Consider the command line "python test.py --vid 0xabcd"
I notice that argparse is raising an exception on this as it fails to complete the call int('0xabcd')
because it is base 16. How do I get argparse to correctly handle this?