Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close the opened file in app.py #14

Open
ai-naymul opened this issue Aug 2, 2023 · 1 comment
Open

Close the opened file in app.py #14

ai-naymul opened this issue Aug 2, 2023 · 1 comment

Comments

@ai-naymul
Copy link

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

@harsh1504660
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants