python - Python比较gz文件的内容
问题描述
我必须在 Python 中比较几对 gz 文件。想法是运行:
f1 = os.popen('file1.gz').read()
f2 = os.popen('file2.gz').read()
print(f1 == f2)
但这似乎很慢,因为应该阅读整个内容。是否有另一种有效的方法来检查 Python 中的 gz 文件是否相等?
解决方案
推荐阅读
- python - 如何不断检查是否按下了特定键
- flutter - 如何让这个页面交易对flutter产生影响
- python-3.x - 禁用按钮仍然可以调用
- r - 如何为 html 和 pdf 创建加权、带标签的汇总表?
- r - 对多列执行 dplyr group by stats,将结果表存储在列表中,并将列表组合为数据框
- typescript - 如何为 H1/H2/.. 标签应用站点范围的样式?
- c++ - c++验证做一个通用函数
- matlab - MATLAB提高求和运算符的性能
- ml.net - 如何在 ML.NET 中获取 OneHotEncoding 标签
- list - SwiftUI Mac OS 如何将选择添加到列表视图