Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Doxin
8 months ago
|
parent
|
context
|
favorite
| on:
Just say no to broken JSON
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: