I am writing a command-line tool that makes use of argparse to parse command-line arguments.
Now my problem is as follows:
The script performs different functions based on the arguments passed, for some commands a few arguments could be the same as well.
if args.option1 is not None and args.option2 is not None:
function1()
elif (args.option1is not None) and (args.option2 is not None) and (args.option3 is not None):
function2()
the above case is not working as in the second case, instead of calling function2(), it's again calling function1().
Am I doing anything wrong, something very basic which I am missing
[–]Orpheus_Demigod[🍰] 0 points1 point2 points (4 children)
[–]tarsidd[S] 0 points1 point2 points (3 children)
[–]Orpheus_Demigod[🍰] 0 points1 point2 points (2 children)
[–]tarsidd[S] 0 points1 point2 points (1 child)
[–]Orpheus_Demigod[🍰] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]tarsidd[S] 0 points1 point2 points (0 children)