[Tutor] This Deletes All my Files

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


> I've tried this and I cannot figure out why this does not work.  

So what happens?
And how are you closing the file?

> open(item,'w').write(open(item,'r').read().replace(' ',''))

I can't see the obvious flaw, but using anonymous files(*) is not
a good idea IMHO.

(*)Unlike anonymous functions ;-)

Alan G.


More information about the Tutor mailing list