Kalebu / Plagiarism-checker-Python

A python project for checking plagiarism of documents based on cosine similarity
https://kalebujordan.dev/how-to-detect-plagiarism-in-text-using-python/
287 stars 138 forks source link

Close the opened file in app.py #14

Open ai-naymul opened 1 year ago

ai-naymul commented 1 year ago

In the 6th and 7th line of file app.py there is a file opened but didn't close Refernce: Screenshot_1

harsh1504660 commented 8 months ago

There is no need to close the file. Since you've already closed the file objects when reading them into student_notes, there's no need to close them again. The code opens the files using a list comprehension, This creates a list of file objects, but Python automatically closes them once the list comprehension finishes and the file contents have been read into the student_notes list.