Feb-23-2017, 11:03 AM
I want to add a string from a passed-in argument and insert it into a dict as a key-value.
The passed-in string is a piece of JSON, eg:
The passed-in string is a piece of JSON, eg:
write_data('"body": {"storage":{"value":"<p>This is a new page</p>","representation":"storage"}}', 1234) def write_data(my_str, pageid): data = { 'id' : str(pageid), <ADD_MY_STR HERE> }so it looks like
def write_data(my_str, pageid): data = { 'id' : str(pageid), "body": {"storage":{"value":"<p>This is a new page</p>","representation":"storage"}} }