I have written a program that calculates the counts of each word in an input file. At the moment I am getting the filename using sys.argv[1], but I am actually supposed to be using
python word_counts.py < homer.txt > homer.test
I think homer.txt is the input file that is directed to my python script, while homer.test is the file that the output of my script is written to.
How do I make these work in my program?