def check_positive(value):
    ivalue = int(value)
if ivalue <= 0:
    raise argparse.ArgumentTypeError('%s is an invalid positive int value' %
        value)
In Python, using argparse, allow only positive integers