如何从现有JSON值创建列表?

时间:2018-05-15 18:31:59

标签: python json

我有一个现有的json文件,想要为特定字段创建一个列表,如何创建它?我经历了特定于python的其他stackoverflow问题,但不是我想要的。

当前的JSON文件:

[{"team_name": "Journalist", "team_members": "Ali Smith, Jon Doe"},
{"team_name": "Journalist & Media", "team_members": "A Smith, Micheal P"},
{"team_name": "Photography", "team_members": "Micheal P, Adam A"}]

最终输出文件:

[{"team_name": "Journalist", "team_members": ["Ali Smith", "Jon Doe"]},
{"team_name": "Journalist & Media", "team_members": ["A Das", "Micheal P"]},
{"team_name": "Photography", "team_members": ["Micheal P", "Adam A"}]

0 个答案:

没有答案