Home
Sign Up
Sign In
V2EX
›
问与答
Python 里两个文件对比速度问题
karlxu
·
Jun 6, 2018
· 1547 views
This topic created in 2923 days ago, the information mentioned may be changed or developed.
两个文件都是 1 万行,每一行的数据都不一样,
d = difflib.HtmlDiff()
d.make_file(file1,file2)
使用 difflib 对比生成 html,发现速度奇慢。。。大概 30 分钟
请教下有没有其他方法?谢谢
difflib
file2
file1
htmldiff
3 replies
•
2018-06-06 17:31:10 +08:00
1
wplct
Jun 6, 2018
??? 要不 用 set ?
2
karlxu
OP
Jun 6, 2018
@
wplct
set 集合去重?我不需要去重。。。只是两个文件对比。
3
wplct
Jun 6, 2018
set 的 交集 并集操作了解一下
set1 & set2
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Solana
·
3099 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 29ms ·
UTC 13:50
·
PVG 21:50
·
LAX 06:50
·
JFK 09:50
♥ Do have faith in what you're doing.
❯