replace string in a file

Unknown cantabile.03 at wanadoo.fr
Sat Mar 15 17:47:12 EDT 2008


Thanks, andrei. I'll try that.

Le Sat, 15 Mar 2008 14:25:21 -0700, andrei.avk a écrit :

> What you want to do is either 1. load everything up into a string,
> replace
> text, close file, reopen it with 'w' flag, write string to it. OR if
> file is too big, you can read each line, replace, write to a temp file,
> then when done move the file over the old one.



More information about the Python-list mailing list