FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python_reference/diff_files.py at master · nacyot/python_reference · GitHub
nacyot
/
python_reference
Public
forked from
rasbt/python_reference
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python_reference
/
diff_files.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
21 lines (16 loc) · 476 Bytes
Breadcrumbs
python_reference
/
diff_files.py
Copy path
File metadata and controls
21 lines (16 loc) · 476 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Sebastian Raschka, 2014
#
# Print lines that are different between 2 files. Insensitive
# to the order of the file contents.
id_set1
=
set
()
id_set2
=
set
()
with
open
(
'id_file1.txt'
,
'r'
)
as
id_file
:
for
line
in
id_file
:
id_set1
.
add
(
line
.
strip
())
with
open
(
'id_file2.txt'
,
'r'
)
as
id_file
:
for
line
in
id_file
:
id_set2
.
add
(
line
.
strip
())
diffs
=
id_set2
.
difference
(
id_set1
)
for
d
in
diffs
:
print
(
d
)
print
(
"Total differences:"
,
len
(
diffs
))
Back
|
FazBrowse Home
|
New Git URL