How to store argparse values in variables?
The canonical way to get the values of the arguments that is suggested in the documentation is to use vars
as you did and access the argument values by name:
argv = vars(args)
one = argv['one']
two = args['two']
three = argv['three']
use args.__dict__
args.__dict__["one"]
args.__dict__["two"]
args.__dict__["three"]
That will work, but you can simplify it a bit like this:
args = parser.parse_args()
foo = args.one
bar = args.two
cheese = args.three