Quote:
Originally Posted by BlueMelon
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!
