[python-nl] os.remove fout

Wichert Akkerman wichert at wiggy.net
Tue Apr 15 21:52:27 CEST 2008


Robert Segaar wrote:
>           infile =open(fname)
>           if os.path.exists(ftemp):
>               os.remove(ftemp)       
>           outfile = open(ftemp,"w")
>           outfile.write(infile.read().replace(search,replace))
>           outfile.flush
>           outfile.close
>           outfile.flush
>           infile.close

Die vier regels doen niks. Als je een functie wil uitvoeren moet je er 
() achterzetten, anders krijg je de functie zelf terug en doe je er niks 
mee.

Wichert.

-- 
Wichert Akkerman <wichert at wiggy.net>   It is simple to make things.
http://www.wiggy.net/                  It is hard to make things simple.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-nl/attachments/20080415/98a73360/attachment.htm 


More information about the Python-nl mailing list