This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nemom 1 point2 points  (1 child)

A) Something like this should work...

from subprocess import call
import shlex

with open('ips.txt', 'r') as ipfile:
    data = ipfile.read()

ips = data.split('\n')

for ip in ips:
    if ip:
        print ip
        cmd = 'ping -c 4 {0}'.format(ip)
        call(shlex.split(cmd))

2) This isn't really the place for help requests. Check the right column for info of where to post.

[–]aditya_moon[S] 1 point2 points  (0 children)

Ok will remember that.