Created by the python DNS excel file format (used to import Ali cloud)

Excel file created by the python, Ali cloud can import domain name resolution!
Due to the need to write scripts work, nothing more difficult to share for your reference
sample code:
# / usr / bin / env Python!
#Coding: UTF-8

import xlsxwriter

servers = a (rigid (001,016))

ym = ". Domain Name"

iplist = [
"192.168.112.100",
"192.168.112.101",
"192.168.112.102"
]

row = 0

def dns():
global row
workbook = xlsxwriter.Workbook('dns.xlsx')
worksheet = workbook.add_worksheet()
for i in range(5):
for inter_ip in iplist:
server_id = str(serverid.pop(0))
server_idstr = "s%s%s" %(server_id,ym)
a = ['A', server_idstr, '默认', inter_ip, '--','600','0']
for l in range(7):
worksheet.write(row,l,a[l])
row += 1
workbook.close()

dns()

Guess you like

Origin blog.51cto.com/11801990/2412456