FileNotFoundError Traceback (most recent call last)
in
15 inputFile = sys.argv[1]
16 outputFile = sys.argv[2]
—> 17 getStemmedDocument(inputFile,outputFile)
in getStemmedDocument(inputFile, outputFile)
3 out = open(outputFile,‘w’,encoding=“utf8”)
4
----> 5 with open(inputFile,encoding=“utf8”) as f:
6 reviews = f.readlines()
7
FileNotFoundError: [Errno 2] No such file or directory: ‘-f’
I am getting this error on running the following code:
def getStemmedDocument(inputFile,outputFile):
out = open(outputFile,'w',encoding="utf8")
with open(inputFile,encoding="utf8") as f:
reviews = f.readlines()
for review in reviews:
cleaned_review = getStemmedReview(review)
print((cleaned_review),file=out)
out.close()
Read command line arguments
inputFile = sys.argv[1]
outputFile = sys.argv[2]
getStemmedDocument(inputFile,outputFile)