Replacing text for all files in a directory

Kemp Randy-W18971 Randy.L.Kemp at
Tue Aug 7 21:25:29 CEST 2001

Since I don't write Python every day, here is a simple question.
I have a directory called test, containing files A, B, ..., Z, and I want to
replace all occurrences of the text "Have a good day" to "jump off a cliff."
This is a comic example, but I need to do something similar in real life.
How can I do this in Python, running on Unix? 

More information about the Python-list mailing list