Remove newline from file in python,"str2 = str.replace('\n', '')"