通过python创建域名解析文件excel格式(可用来导入阿里云)
2020-12-13 03:27
标签:row usr 分享 for range 创建 脚本 默认 int import xlsxwriter serverid = list(range(001,016)) ym = ".域名" iplist = [ row = 0 def dns(): dns() 通过python创建域名解析文件excel格式(可用来导入阿里云) 标签:row usr 分享 for range 创建 脚本 默认 int 原文地址:https://blog.51cto.com/11801990/2412456
因工作需要编写的脚本,没啥难度,分享出来供大家参考
示例代码:
#!/usr/bin/env python
#coding:utf-8
"192.168.112.100",
"192.168.112.101",
"192.168.112.102"
]
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()
文章标题:通过python创建域名解析文件excel格式(可用来导入阿里云)
文章链接:http://soscw.com/essay/27621.html