import subprocess as sp ip = "192.168.1.4" status, result = sp.getstatusoutput("ping -c1 -w2" + ip) if(status ==0): print("UP") else: print("DOWN")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)