{"type":"rich","height":"190","provider_name":"Hatena Blog","url":"https://mzp.hatenadiary.org/entry/20080223/diff","provider_url":"https://hatena.blog","version":"1.0","categories":["Python","30\u5206\u30d7\u30ed\u30b0\u30e9\u30e0"],"blog_url":"https://mzp.hatenadiary.org/","author_name":"mzp","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmzp.hatenadiary.org%2Fentry%2F20080223%2Fdiff\" title=\"Python\u3067diff - \u307f\u305a\u3074\u30fc\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":null,"title":"Python\u3067diff","blog_title":"\u307f\u305a\u3074\u30fc\u65e5\u8a18","description":"30\u5206\u30d7\u30ed\u30b0\u30e9\u30e0\u3001\u305d\u306e252\u3002Python\u3067diff\u3092\u4f5c\u3063\u3066\u307f\u308b\u3002 diff\u3092\u3061\u3083\u3093\u3068\u4f5c\u308b\u3068\u5927\u5909\u305d\u3046\u3060\u3051\u3069\u3001Python\u306edifflib\u3092\u4f7f\u3048\u3070\u7c21\u5358\u306b\u3067\u304d\u308b\u3002 >>> import >>> a = file('foo').readlines() >>> b = file('bar').readlines() >>> difflib.unified_diff(a,b) \u3068\u3059\u308b\u3060\u3051\u3067\u3001diff\u304c\u3068\u308c\u3061\u3083\u3046\u3002\u4fbf\u5229\u3001\u4fbf\u5229\u3002 \u4f7f\u3044\u65b9 $ python diff.py ~/tmp/foo ~/tmp/bar --- /Users/mzp/tmp/foo Sat Feb 23 21:51:47 2008 +\u2026","published":"2008-02-23 00:00:00","width":"100%","author_url":"https://blog.hatena.ne.jp/mzp/"}