Thread: Staff Activity
View Single Post
  #14  
Old 09-14-2012, 07:14 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by BlueMelon View Post
After a bit of research,

PHP Code:
log open('rclog.txt','r').readlines() 
Will automatic close the file descriptor (handle) once the python garbage collector finds it.

Its better to explicitly use a variable handle, or a with-block but since its a small script that will only be ran once in a while, it doesn't really matter.
For bigger projects though, you would need to close it.
IT'S BAD PRACTICE *rant* I'M TELLING YOU!
Reply With Quote