vobject

To remove vcard contact duplicates, comparing if two vcards are equal in .vcf file does not work with simple == vobject comparison

家住魔仙堡 提交于 2019-12-12 01:22:25
问题 #!/usr/bin/env python2.7 import vobject abfile='/foo/bar/directory/file.vcf' #ab stands for address book ablist = [] with open(abfile) as source_file: for vcard in vobject.readComponents(source_file): ablist.append(vcard) print ablist[0]==ablist[1] The above code should return True but it does not because the vcards are considered different even though they are the same. One of the ultimate objectives is to find a way to remove duplicates from the vcard file. Bonus points: Is there a way to