如何使用python

如何使用python,python,Python,你好,我想知道如何转换这个 0|13|16|16|3|"After MLG down and securely locked, a red light is illuminated \ n the flight deck. The possible causes are." \ |out of adjustment sensor|wiring problem|shorted sensor|b|1| |zita-2686 进入这个 0|13|16|16|3|

你好,我想知道如何转换这个

 0|13|16|16|3|"After MLG down and securely locked, a red light is illuminated \
n the flight deck. The possible causes are."        \
|out of adjustment sensor|wiring problem|shorted sensor|b|1| |zita-2686
进入这个

 0|13|16|16|3|"After MLG down and securely locked, a red light is illuminated the flight deck. The possible causes are." |out of adjustment sensor|wiring problem|shorted sensor|b|1| |zita-2686

你能帮帮我吗,因为我没有找到任何类似的

有很多方法可以将新行字符替换为零。尝试以下任何一种方法

string = string.replace("\r","");
or
string = string.replace("\r\n","");
or
string = string.replace("\n","");
or
re.sub(r'\s' , '\n', line);

为什么在最终结果中航班丢失前n这应该是什么?你能提供更多的上下文吗?@dantechguy这是一个字符串,但我需要全部用python编写,我一直在尝试,但都不起作用,然后我尝试了所有这些,我不知道我的问题是什么,但太过分了。你是否已将“字符串”变量重命名为代码中使用的变量?如果是这样的话,那么字符串中就没有看起来像有的新行了。