Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Nz2 for Antichat
- login = 'admin'
- password = 'admin'
- file = open('IPs.txt','r')
- xml = open('ip_out.xml','w')
- def main():
- start_file='''<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <Organization groups="2" grade="1" modifiedTime="0">
- <Department coding="001" encode="" id="0" name="root" type="0">
- '''
- end_file='''
- </Department>
- </Organization>'''
- k = 1001
- xml.write(start_file)
- for string in file.readlines():
- line = string.rstrip('\n')
- temp = '<Device id="'+str(k)+'" title="'+line+'" desc="" ip="'+line+'" port="37777" manufacturer="" type="1" model="" user="'+login+'" password="'+password+'" p2pServerIp="" p2pServerPort="0" p2pServerKey="" p2pDevUuid="" p2pRemotePort="0" logintype="0" cardsn="" rights="" alertout="0" status="1" m_ChannelCount="" VideoOutCount="" AlarmInCount="0" AlarmOutCount="0" SerialNum="" subType="1" ProtocolType="0" RtspPort="0" AutoLogin="1">\n </Device>'
- xml.write(temp)
- k += 1
- xml.write(end_file)
- xml.close()
- file.close()
- print('Файл готов импортируйте в Smart Pss')
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement