Hello,

text = file(filename).read()

(or: open(filename).read())

How do you close() the file? ;-)
Is it, in fact, automagically closed after end-of-statement if not bound to a 
name? Or when the execution path quits the present scope (func, module), like 
if it had been bound to a local var? Or what else?
Said differently: in this case, how long does the python file object live / 
does the file in file system remain locked?

I would love case #1.

This may be implementation-dependant, no?

Denis
------
la vita e estrany
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to