I'm fairly confused as to the proper implementation of command line arguments in a program. I've looked around and am confused whether or not a for loop is necessary. I know for sure that there will always be only two arguments passed to this program. Ultimately, is a for loop necessary in this situation? Here's the code in the main function:
def main():
try:
if len(sys.argv) > 1:
filename = sys.argv[1]
length = int(sys.argv[2])
wordDict = readFile(filename)
except IOError:
print("Error: file not found.")
Thank you all for your input!