Guest User

Untitled

a guest
Jun 14th, 2018
828
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def ping(host):
  2.     process = subprocess.Popen(["ping", "-n", "1",host], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  3.     streamdata = process.communicate()[0]
  4.     #print(str(streamdata))
  5.     if not 'Reply from {}'.format(host) in str(streamdata):
  6.         return 1
  7.     else:
  8.         return 0
Add Comment
Please, Sign In to add comment