python if host up code example Example: check if host is reachable python HOST_UP = True if os.system("ping -c 1 " + SOMEHOST) is 0 else False