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