import re
import os
fp=open("d:/zabbix_agents_2.4.1.win/conf/zabbix_agentd.win.conf",'r')
alllines=fp.readlines()
fp.close()
fp=open("d:/zabbix_agents_2.4.1.win/conf/zabbix_agentd.win.conf",'w')
for eachline in alllines:
a=re.sub('192.168.2.23','192.168.2.26',eachline)
fp.writelines(a)
fp.close()
os.system('net stop "zabbix agent"')
os.system('net start "Zabbix Agent"')