res = subprocess.call(['ping', '-c', '3', address])
if res == 0:
    print('ping to', address, 'OK')
elif res == 2:
    print('no response from', address)
else:
    print('ping to', address, 'failed!')
Multiple ping script in Python