Entering Replace Or Append Command In Python