#!/usr/bin/env python3
import requests

for i in range(1,255):
    try:
        #url = 'http://172.16.90.129/xmlService'
        url = 'http://172.16.90.'+str(i)+'/xmlService'
        myData = open("FanvilConfiguration.xml", encoding="utf-8").read()
        myHeaders = {'Content-Type': 'text/xml',}

        requests.post(url, data = myData.encode(encoding="utf-8"), headers = myHeaders)
    except:
        print('172.16.90.'+str(i)+'is not available')
        pass
    continue
print('Finished')
