parsing a dictionary / preventing string from collapsing?

geotrupede's icon

Hi there, I am trying to process the following dictionary. the key body comes out as:

body string u092006682

any other key, the numerical one are ok and seen as number.

this is the dictionary:

{
	"body" : "{\"lat\":\"44.7031N\",\"lon\":\"10.6346E\",\"elevation\":55,\"timezone\":\"Europe/Rome\",\"units\":\"metric\",\"current\":{\"icon\":\"mostly_cloudy\",\"icon_num\":29,\"summary\":\"Mostly cloudy\",\"temperature\":4.5,\"wind\":{\"speed\":0.8,\"angle\":82,\"dir\":\"E\"},\"precipitation\":{\"total\":0.0,\"type\":\"none\"},\"cloud_cover\":80},\"hourly\":null,\"daily\":null}",
	"status" : 200,
	"connect_code" : 0,
	"file_time" : -1,
	"total_time" : 0.244132,
	"size_upload" : 0.0,
	"size_download" : 315.0,
	"content_length_download" : 315.0,
	"content_length_upload" : 0.0,
	"content_type" : "application/json"
}

Anyone knows how to tackle this?

G>

PS I did find other examples from the past but none seems to address this issue unless I have misunderstood.

TFL's icon

You can use @legacy 1 in dict objects to force them output symbols and lists instead of string and array objects. [string.tosymbol] and [string.tolist] is another solution.

Max Patch
Copy patch and select New From Clipboard in Max.

geotrupede's icon

problem solved! thank you!