Python raw_input messing up string concatenation

前端 未结 3 1505
梦谈多话
梦谈多话 2021-01-22 20:21

I am trying to do something relatively simple in Python and am surprised at how badly this isn\'t working for how simple it should be.

I\'m here just trying to concatena

3条回答
  •  無奈伤痛
    2021-01-22 20:47

    You're running under Windows, correct? The string you enter is terminated by a DOS line ending, so that ProjRegex consists of test1abc\rtest2. When printed, the \r moves the cursor to the beginning of the line, at which point test2 overwrites test1.

提交回复
热议问题