Changing a line in a text file

Simon Brunning simon.brunning at gmail.com
Tue Apr 26 04:45:58 EDT 2005


On 4/25/05, Kirk Job Sluder <kirk at jobsluder.net> wrote:
> In addition, I would argue that editing a file in place using a
> non-interactive program is dangerous and bad practice in general.  By
> the time you find a bug in your edit script, the original is lost.  This
> is something I learned from bitter experience when I tried to be smart
> and make script-based edits over entire directories of html files.

See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/56037

-- 
Cheers,
Simon B,
simon at brunningonline.net,
http://www.brunningonline.net/simon/blog/



More information about the Python-list mailing list