Ping to multiple IP address with python

1 year ago
14

#Ping to multiple IP address

import os
import time
import random

txt_file = input('Please enter IP addresses list text file location\n')
ip_list = open(txt_file,"r")
time_delay = random.randrange(1,5)

for ip in ip_list:
print('Pinging Now the follwing host IP address:',ip)
print('_'*50)
os .system('ping -n 2 -w 1500 {}'.format (ip))
print('_'*50)
time.sleep(time_delay)

Loading comments...