保存列表为.txt文件
#1/list写入txt
ipTable = ['158.59.194.213', '18.9.14.13', '58.59.14.21']
fileObject = open('sampleList.txt', 'w')
for ip in ipTable:
fileObject.write(ip)
fileObject.write('\n')
fileObject.close()
保存列表为.txt文件
#1/list写入txt
ipTable = ['158.59.194.213', '18.9.14.13', '58.59.14.21']
fileObject = open('sampleList.txt', 'w')
for ip in ipTable:
fileObject.write(ip)
fileObject.write('\n')
fileObject.close()