标签:row usr 分享 for range 创建 脚本 默认 int
通过python创建excel文件,可导入阿里云域名解析!import xlsxwriter
serverid = list(range(001,016))
ym = ".域名"
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()
通过python创建域名解析文件excel格式(可用来导入阿里云)
标签:row usr 分享 for range 创建 脚本 默认 int
原文地址:https://blog.51cto.com/11801990/2412456