Python - 製作 JSON serializable 的類別
Python 的 json 模組十分方便,可以把 dict() tuple() list() str() int() 等資料型別轉成 JSON 字串,不過遇到像是 set() 時,就會產生以下錯誤: >>> import json >>>…
1 篇
Python 的 json 模組十分方便,可以把 dict() tuple() list() str() int() 等資料型別轉成 JSON 字串,不過遇到像是 set() 時,就會產生以下錯誤: >>> import json >>>…