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
  • 16,554
  • 10
  • 50
  • 78

0 Answers0