小编Joh*_*ohn的帖子

将dicts列表转换为字符串

我对Python很新,所以请原谅我,如果这比我看起来更容易.

我将收到如下所示的词条列表:

[{'directMember': 'true', 'memberType': 'User', 'memberId': 'address1@example.com'},  
 {'directMember': 'true', 'memberType': 'User', 'memberId': 'address2@example.com'},  
 {'directMember': 'true', 'memberType': 'User', 'memberId': 'address3@example.com'}]
Run Code Online (Sandbox Code Playgroud)

我想生成一个简单的memberIds字符串,例如

address1 @ example.com,address2 @ example.com,address3 @ example.com

但是每个将列表转换为我尝试过的字符串的方法都会失败,因为涉及到dicts.

有什么建议?

python string dictionary list

7
推荐指数
2
解决办法
1万
查看次数

标签 统计

dictionary ×1

list ×1

python ×1

string ×1