In Python, I have a string:
a = "\s" In JavaScript, a would be the single letter "s", but in Python, a would be "\s".
How can I make Python behave the same way as JavaScript in this situation?
the real case may be more complicate :
a = "<div class=\"haha\"><\/div>" , In this case , JavaScript get right HTML but python failed
a="s". There is some differences between languages. Your string is\sif you want an output likesthen you have to change it. Otherwise I don't see anything wrong here. Or use regex .