phanas/nas.py
def __ping(self, host):
        """
        Returns True if host (str) responds to a ping request.
        Remember that a host may not respond to a ping (ICMP) request even if the host name is valid.
        """

        # Option for the number of packets as a function of
        param = "-n" if platform.system().lower()=="windows" else "-c"

        # Building the command. Ex: "ping -c 1 google.com"
        command = ["ping", param, "1", host]

        # call local ping command, suppress stdout and stderr output as we only care about exit code
        return subprocess.call(command, stdout=DEVNULL, stderr=DEVNULL) == 0

        Returns True if host (str) responds to a ping request.
        Remember that a host may not respond to a ping (ICMP) request even if the host name is valid.
        
Returns True if host (str) responds to a ping request.
Remember that a host may not respond to a ping (ICMP) request even if the host name is valid.
Returns True if host ( str ) responds to a ping request . Remember that a host may not respond to a ping ( ICMP ) request even if the host name is valid .
def __ping(self, host):
        param = "-n" if platform.system().lower()=="windows" else "-c"
        command = ["ping", param, "1", host]
        return subprocess.call(command, stdout=DEVNULL, stderr=DEVNULL) == 0
def __ping ( self , host ) : param = "-n" if platform . system ( ) . lower ( ) == "windows" else "-c" command = [ "ping" , param , "1" , host ] return subprocess . call ( command , stdout = DEVNULL , stderr = DEVNULL ) == 0
Returns True if host (str) responds to a ping request.
Returns True if host ( str ) responds to a ping request .
"""
        Returns True if host (str) responds to a ping request.
        Remember that a host may not respond to a ping (ICMP) request even if the host name is valid.
        """ # Option for the number of packets as a function of # Building the command. Ex: "ping -c 1 google.com" # call local ping command, suppress stdout and stderr output as we only care about exit code
self
host