Skip to content

Instantly share code, notes, and snippets.

@StephenFordham
Created April 17, 2019 19:44
Show Gist options
  • Save StephenFordham/7db4b1e5e0dd595bb73c99162efe517b to your computer and use it in GitHub Desktop.
Save StephenFordham/7db4b1e5e0dd595bb73c99162efe517b to your computer and use it in GitHub Desktop.
count_valid
def count_valid(count_no):
num = int(count_no)
if num < 1:
raise argparse.ArgumentTypeError('The count has to be an integer above 0')
return num
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment