看板 Python 關於我們 聯絡資訊
請問有模組可以把下面這段string轉成dict格式嗎? (dict中的dict和list也要一併轉換成dict和list) 謝謝 '{ "dpid": 1, "cookie": 1, "cookie_mask": 1, "table_id": 0, "idle_timeout": 30, "hard_timeout": 30, "priority": 11111, "flags": 1, "match":{ "in_port" : 1 }, "actions": [ { "type":"OUTPUT", "port": 2 } ] }' -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.228.145.178 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1478056653.A.9C6.html
alibuda174: eval 11/02 11:22
kenduest: 去除換行字元後用 json 內的 json.loads 讀入即可 11/02 11:58
Raymond0710: json.loads 11/02 12:17
ukyo1024: 感謝樓上諸位 11/02 18:23
aweimeow: OVS 嗎 XD 11/02 20:52