0

I have strange problem during splitting the string like in case below.

my_str before splitting

mystr="
77
---->3
-------->33
-------->'n'
------------>'|'
---------------->'G'
-------------------->51
------------------------>'|'
------------------------>'Z'
------------------------>'d'
------------------------>'L'
-------------------->'Z'
------------>73
---------------->'F'
-------------------->35
------------------------>'Y'
------------------------>'='
-------------------->'u'
------------------------>57
------------------------>96
------------------------>'T'
------------------------>'d'
-------------------->'}'
------------------------>'x'
------------------------>'\\'
------------------------>'#'
------------------------>31
------------------------>47
-------------------->'m'
---------------->'I'
---------------->']'
---------------->8
------------>48
------------>73
------------>'b'
---->80
---->'X'
---->82
"

my_str after splitting:

my_str = ['77', '---->3', '-------->33', "-------->'n'", "------------>'|'", "---------------->'G'", '-------------------->51', "------------------------>'|'", "------------------------>'Z'", "------------------------>'d'", "------------------------>'L'", "-------------------->'Z'", '------------>73', "---------------->'F'", '-------------------->35', "------------------------>'Y'", "------------------------>'='", "-------------------->'u'", '------------------------>57', '------------------------>96', "------------------------>'T'", "------------------------>'d'", "-------------------->'}'", "------------------------>'x'", "------------------------>'\\\\'", "------------------------>'#'", '------------------------>31', '------------------------>47', "-------------------->'m'", "---------------->'I'", "---------------->']'", '---------------->8', '------------>48', '------------>73', "------------>'b'", '---->80', "---->'X'", '---->82', '']

To split this i have used this function.

my_str=my_str.split("\n")

------------------------>'\\' is changing to "------------------------>'\\\\'"

anybody knows why?

user13137381
  • 95
  • 2
  • 9

0 Answers0