In [1]:
python argparse_type_int.py 100


100
<type 'int'>

In [2]:
python argparse_type_int.py foo


usage: argparse_type_int.py [-h] arg_int
argparse_type_int.py: error: argument arg_int: invalid int value: 'foo'


In [3]:
python argparse_type_int.py 1.23


usage: argparse_type_int.py [-h] arg_int
argparse_type_int.py: error: argument arg_int: invalid int value: '1.23'


In [4]:
python argparse_type_bool.py True


True
<type 'bool'>

In [5]:
python argparse_type_bool.py False


True
<type 'bool'>

In [6]:
python argparse_type_bool.py bar


True
<type 'bool'>

In [7]:
python argparse_option_bool.py --en


True
<type 'bool'>

In [8]:
python argparse_option_bool.py


False
<type 'bool'>

In [9]:
python argparse_type_strtobool.py true


1
<type 'int'>

In [10]:
python argparse_type_strtobool.py false


0
<type 'int'>