blob: 1ec660e68f6264cf1f10b20af743604a09792ad0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""python diff.py file1 file2 diff"""
import difflib
import sys
diff = difflib.unified_diff(
open(sys.argv[1], encoding='utf-8').readlines(),
open(sys.argv[2], encoding='utf-8').readlines())
with open(sys.argv[3], 'w', encoding='utf-8') as f:
f.write(''.join(diff))
|