首页 > 编程语言 > 详细

python 比较两台linux系统rpm包安装是否相同

时间:2018-03-26 16:47:24      阅读:275      评论:0      收藏:0      [点我收藏+]
import re

Setaliyun=set(‘‘)
Setczgame=set(‘‘)
with open(‘alirpm.txt‘,‘r‘) as f:
for line in f:
Result=re.subn(‘-\d.*‘,‘‘,line)[0]
Setaliyun.add(Result)
#print(Setaliyun)

with open(‘gamerpm.txt‘,‘r‘) as f:
for line in f:
Result=re.subn(‘-\d.*‘,‘‘,line)[0]
Setczgame.add(Result)
#print(Setczgame)

#print(Setaliyun-Setczgame)
print(Setczgame-Setaliyun)

python 比较两台linux系统rpm包安装是否相同

原文:http://blog.51cto.com/sjitwant/2091213

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!