53-集合的使用:取出差异的内容


with open('./passwd') as fobj:
    aset = set(fobj)
    print(aset)

with open('./mima') as fobj:
    bset = set(fobj)
    print(bset)

with open('diff.txt', 'w') as fobj:
    fobj.writelines(aset - bset)

结果输出:

 


posted @ 2019-05-29 15:23  hejp  阅读(138)  评论(0编辑  收藏  举报