I'm using python 3.6 and I'm trying to do a program that requires arguments, but I can not use it because I can't pass the arguments. Another question: I can't understand the dest parameter; is it to create a variable with that name?
#!/usr/bin/env python3
import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('-m', '--mac',
help='Introduce your new MAC' +
'use random as value if you want to have a random mac',
action="store_true", required=True)
parser.add_argument('-i', '--interface',
help='The interface that the MAC will be changed',
action="store", required=True)
args = parser.parse_args()
print(args.mac + args.interface)
I´m getting this error, when trying to use it (I use hi and bye as examples)
> python '.\test.py' -m hi -i bye
usage: test.py [-h] -m -i INTERFACE
test.py: error: unrecognized arguments: hi