[Tutor] This Deletes All my Files

Alan Gauld alan.gauld at freenet.co.uk
Fri Feb 4 11:14:37 CET 2005


> So the first argument evaluated is "self" ... and in your case
"self" is
> "open(item, 'w')" so the first thing your line does is opening for
> writing the file named by "item" and as "w" empty the file ... you
can
> read it afterward, it will be empty !

Ah! well spotted Pierre, I hadn't noticed that both input and
output files were the same file!

Alan G.



More information about the Tutor mailing list