Plagiarism-checker-Python icon indicating copy to clipboard operation
Plagiarism-checker-Python copied to clipboard

Close the opened file in app.py

Open ai-naymul opened this issue 2 years ago • 1 comments

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

ai-naymul avatar Aug 02 '23 14:08 ai-naymul

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.

harsh1504660 avatar Feb 24 '24 21:02 harsh1504660