Lecture Notes on 18 July 2011 import string def main(): inFile = open ("rhyme.txt", "r") lines = inFile.read() print lines index = lines.find ("Up") s1 = lines[ :index] s2 = lines[index: ] s3 = "Into infinity and beyond \n" inFile.close() outFile = open ("rhyme.txt", "w") outFile.write (s1) outFile.write (s3) outFile.write (s2) outFile.close() main()