assignment9

assignment9

by Khashayar Namdar -
Number of replies: 7

Are we fine to use the sys lib to handle cmdline args?


In reply to Khashayar Namdar

Re: assignment9

by Erik Spence -
Using the argparse package is the preferred method, but using sys.argv is acceptable.
In reply to Khashayar Namdar

Re: assignment9

by Alexey Fedoseev -
Although `argparse` is a preferred way to deal with command line arguments, you can use `sys.argv` as well.
In reply to Alexey Fedoseev

Re: assignment9

by Mansi Jain -
Hi profs.,

Do we need to add a function to defend command line argument(s) in this assignment?
In reply to Mansi Jain

Re: assignment9

by Erik Spence -
Yes, the command-line arguments should be defended, including no command-line arguments.
In reply to Erik Spence

Re: assignment9

by Mansi Jain -
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.
In reply to Mansi Jain

Re: assignment9

by Erik Spence -
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.