问题描述 我打算更改文件user_list2中的内容, 本来的想法是加一个temp 文件. 先把user_list2的内容读取并修改后写入temp, 之后再写回来. 但是在读取内容并修改后写入temp这一段, 就因为r+ 和a+的问题产生了困扰. def replace(arg1): for line in user_list2.readlines(): if name == line.split(',')[0]: line = line.replace(line.split(',')[2],…
newline controls how universal newlines mode works (it only applies to text mode). It can be None, '', '\n', '\r', and '\r\n'. It works as follows: [...] When writing output to the stream, if newline is None, any '\n' characters written are translate…