Are we fine to use the sys lib to handle cmdline args?
Using the argparse package is the preferred method, but using sys.argv is acceptable.
Although `argparse` is a preferred way to deal with command line arguments, you can use `sys.argv` as well.
Hi profs.,
Do we need to add a function to defend command line argument(s) in this assignment?
Do we need to add a function to defend command line argument(s) in this assignment?
Yes, the command-line arguments should be defended, including no command-line arguments.
Dear prof. Erik,
What all should we check for the command-line arguments? Would checking the 'number of arguments entered' apart from the 4 conditions mentioned in the assignment (0,1,2,anything else) suffice? Also, do we need to create a separate function for checking the number of arguments entered or can we do that in selectStat.py itself after reading the arguments? Thank you.
What all should we check for the command-line arguments? Would checking the 'number of arguments entered' apart from the 4 conditions mentioned in the assignment (0,1,2,anything else) suffice? Also, do we need to create a separate function for checking the number of arguments entered or can we do that in selectStat.py itself after reading the arguments? Thank you.
There aren't many things to check: number of arguments and that the argument is one of the correct values. You do not need to create a separate function to process your arguments. You may process them in the driver script.
Thanks!