How to automatically change a particular word while writing to a file in python?
Say a method returns me a long list of lines which I am writing to file. Now on fly is there any way I can change the word "Bread" to "Breakfast", assuming word "Bread" actually exists in several places of my file that is being generated.
I have assigned the sys.stdout to file object, that way all my console print goes to file. So on fly hack would be great.