Working with files

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)

hey @manishasingla67 ,
kindly let me know what command have you provided from cmd .

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.