Thanks for all your help guys, I am getting a strong consensus that
f.close() should be used everywhere, reading files as well as writing
files and not to rely on the PVM to do clean-up for you.

The whole topic came up because I just finished reading 'learning
python' 3rd edition OReilly as a refresher where there are multiple
instances of suggesting that you do the exact opposite eg ...

[line.rstrip() for line in open('myfile')] ... p361
for line in open('script1.py') ... p261& p276 where it is described as
'best practice' for reading files line by line
etc ...


Dave



-- 

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to