pyhon如何写入txt文件
1.创建txt文件 open + w
2.写入文件 write() 方法
with open('ping-success.txt', 'a') as f: f.write(ip + ' ')