Simple question but I\'m struggling with it for too much time. Basically I want to split a string by \\ (backslash).
a = \"1\\2\\3\\4\"
Tr
According to this answer:
https://stackoverflow.com/a/2081708/3893465
you'll need to escape the backslashes before splitting as such:
>>> a = "1\2\3\4" >>> a.encode('string-escape').split("\\x") ['1', '02', '03', '04']