Represent List as a String with Double-Quotes Instead of Single-Quotes for JSON [duplicate]
Are you trying to output JSON? In that case you should use json.dumps
:
import jsonjson.dumps(mylist)
This outputs: '["a", "b"]'
.
Are you trying to output JSON? In that case you should use json.dumps
:
import jsonjson.dumps(mylist)
This outputs: '["a", "b"]'
.