How do I modify the last line of a file?,f.close()