为了账号安全,请及时绑定邮箱和手机立即绑定

python 如何进行以下list 元素去重

python 如何进行以下list 元素去重

LEATH 2019-04-09 20:24:46
如何将以下list去重url_list=[{'path':['jy5','xhr','compose','init.do'],'host':'cwebmail.mail.163.com','method':'POST','query':['cType','sid']},{'path':['jy5','xhr','user','refresh.do'],'host':'cwebmail.mail.163.com','method':'POST','query':['sid']},{'path':['jy5','xhr','compose','compose.do'],'host':'cwebmail.mail.163.com','method':'POST','query':['action','sid']},{'path':['jy5','data','analytics.s'],'host':'cwebmail.mail.163.com','method':'GET','query':['product','uid','host','fun','data','_']},{'path':['jy5','swf','upload2.swf'],'host':'cwebmail.mail.163.com','method':'GET','query':[]},{'path':['jy5','data','analytics.s'],'host':'cwebmail.mail.163.com','method':'GET','query':['product','uid','host','fun','data','_']},{'path':['jy5','xhr','user','refresh.do'],'host':'cwebmail.mail.163.com','method':'POST','query':['sid']},{'path':['jy4-app','xhr','dropbox','account','check.do'],'host':'jy4-app.mail.163.com','method':'POST','query':['utoken','sid']}]转换成以下的listurl_list=[{'path':['jy5','xhr','compose','init.do'],'host':'cwebmail.mail.163.com','method':'POST','query':['cType','sid']},{'path':['jy5','xhr','user','refresh.do'],'host':'cwebmail.mail.163.com','method':'POST','query':['sid']},{'path':['jy5','xhr','compose','compose.do'],'host':'cwebmail.mail.163.com','method':'POST','query':['action','sid']},{'path':['jy5','data','analytics.s'],'host':'cwebmail.mail.163.com','method':'GET','query':['product','uid','host','fun','data','_']},{'path':['jy5','swf','upload2.swf'],'host':'cwebmail.mail.163.com','method':'GET','query':[]},{'path':['jy4-app','xhr','dropbox','account','check.do'],'host':'jy4-app.mail.163.com','method':'POST','query':['utoken','sid']}]
查看完整描述

2 回答

?
猛跑小猪

TA贡献1858条经验 获得超8个赞

想到一个办法,不知道有没有更好的方法?欢迎回答
url_list_uniq=[]
forurlinurl_list:
ifurlnotinurl_list_uniq:
url_list_uniq.append(url)
printurl_list_uniq
                            
查看完整回答
反对 回复 2019-04-09
  • 2 回答
  • 0 关注
  • 394 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信