+ 1
Why using a variable?
Writing file=open(....), I don't get what kind if variable "file" is, and why it helps to close file instead of, say, close("file.txt") or something like this. Do you then modify the content of a variable?! Is it used as an implicit pointer? Oo
1 Réponse
+ 1
open return a file object (see POO chapter). The type of file is then and object of the class file. That is why you always use method of this object : file.read(), file.close()...