Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Part of the confusion here is that writing '{"key": "value\nda"}' in python is NOT producing a string like this:

    {"key": "value\nda"}
but instead like this:

    {"key": "value
    da"}
you need to either double-escape it, or use raw strings. In python these both:

    '{"key": "value\\nda"}'
    r'{"key": "value\nda"}'
will produce the following string:

    {"key": "value\nda"}


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: