码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2018-03-26 16:54:21      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:python

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包安装是否相同

标签:python

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!