【发布时间】:2017-03-25 18:22:54
【问题描述】:
所有IP地址逐行写入文件中,它将由给定的命令行执行。我想将结果保存到每个文件中,文件名由每个 IP 代表。
with open(list) as l:
for line in l:
file = line+".txt"
os.system("whois "+line+" >> "+file)
列表包含:
192.168.0.1
192.168.0.2
192.168.0.3
错误:
sh: 3: .txt: not found
sh: 3: .txt: not found
sh: 3: .txt: not found
【问题讨论】:
标签: python