Newbie question: string replace

Alex Martelli aleaxit at
Sat Oct 29 04:56:37 CEST 2005

Mike Meyer <mwm at> wrote:

> "usgog at" <usgog at> writes:
> > So how to overwrite the config file directly in instead of
> > running with two params?
> Don't overwrite the file directly. Save a copy, then rename it. That

See module fileinput in the standard library, it does this for you
automatically when used in the right way -- much better than rolling
your own and having to debug it and maintain it forever!


More information about the Python-list mailing list