#!/usr/bin/python
import subprocess
import platform 
host = "192.168.2."
for x in range(1,255):
    print("testing ", x )
    param = '-n' if platform.system().lower()=='windows' else '-c'
    command = ['ping', param, '1', host + str(x)]
    subprocess.call(command) == 0
