python 文本比较
摘要:
#!/usr/bin/env python# -*- coding: utf-8 -*-import difflibfrom difflib import *def compare(stream1,stream2): lines1 = stream1.splitlines() lines2 = stream2.splitlines() result=list(Differ().compare(lines1,lines2)) print str(result)if __name__ == '__main__': s1="hello\nword\nwww\n" 阅读全文
posted @ 2012-03-13 14:40 codestyle 阅读(623) 评论(0) 推荐(0)
浙公网安备 33010602011771号