JPing.py

import subprocess, os
from subprocess import *

print "Enter the IP as shown below\n"
print "JPing('IP1','IP2','IP3',......)\n\n"
def JPing(*IP):

    for ip in IP:
        response=Popen(['ping ',ip,'-n', '1'],stdout=PIPE).communicate()[0]
        if 'bytes=32' in response :
            print ip + ' Link UP'
            
        else:
            print ip + ' Link DOWN'