def ping_host(self,host_name):
"""ping host to check if its active"""
return_responce = os.system('ping -c 1 ' + host_name)
if return_responce == 0:
return True
else:
return False
答案 0 :(得分:2)
x=ping_host(self, host_name)
print(x)