-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdifffile.py
More file actions
37 lines (29 loc) · 1.09 KB
/
Copy pathdifffile.py
File metadata and controls
37 lines (29 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import difflib
import sys , fileinput
text1 = '''Presentation of the API
=======================
The IP class allows a comfortable parsing and handling for most
notations in use for IPv4 and IPv6 addresses and networks. It was
greatly inspired by RIPE's Perl module NET::IP's interface but
doesn't share the implementation. It doesn't share non-CIDR netmasks,
so funky stuff like a netmask of 0xffffff0f can't be done here.
'''
text2 = '''
Presentation of the BPI
=======================
The IP class allows a comfortable parsing and handlingab for most
notations in use for IPv4 and IPv6 addresses and networks. It was
greatly inspired by RIPE's Perl modulel NET::IP's interface but
doesn't share the implementation. It doesn't share non-CIDR netmasks,
so funky stuff like a netmask of 0xffffAAf can't be done here1.
'''
text1_line = text1.splitlines()
text2_line = text2.splitlines()
d = difflib.HtmlDiff()
with open('res.html','w') as f:
for line in d.make_file(text1_line,text2_line):
f.write(line)
f.close()
#t = 'my..name..is..boob'
#
#print(t.split('..'))