I have multiple function
def function1(x,y,z):
do something
def function2():
do something
I want call the function1 as the default function while I execute it from the cmd. I tried this following example this
parser = argparse.ArgumentParser(description='Generating report for Multikey usage')
parser.add_argument('--function1',dest='action', action='store_const', const=function1)
parser.add_argument('--a',type=str,help=' enter the association Id ')
parser.add_argument('--d',type=int,help=' enter the number of days from today ')
parser.add_argument('--e',type=str,help=' enter the receivers email ')
args = parser.parse_args()
x,y,z = args.a, args.d , args.e
But it's not working. What I am doing wrong? Is there a way i dont have to specify the function name from cmd. Example, From the cmd I want to give I/O as
python Multikey_report_1.py --a AS000000008S --d 200 --e blah@gmail.com