Python 3 replace line in file