Please test this file.

If you want a hint of how to do it, I'd suggest receiving the line file and the target file at sys.argv, and at least test a function that does these replacements. So, in the end, there's no need to use a template of a Python script.