2

If I read my file like this:

f = open('path_to_file').readlines()
...more..code...

What happens to the file object? When will it close and get garbage collected?

Can anyone explain behind the scenes?

Mohammad Yusuf
  • 15,118
  • 9
  • 44
  • 71

0 Answers0