#!/usr/bin/env python
# coding: utf-8

"""
    A pure python ping implementation using raw sockets.

    Note that ICMP messages can only be send from processes running as root
    (in Windows, you must run this script as 'Administrator').

    Bugs are naturally mine. I'd be glad to hear about them. There are
    certainly word - size dependencies here.

    :homepage: https://github.com/socektubs/Pyping/
    :copyleft: 1989-2011 by the python-ping team, see AUTHORS for more details.
    :license: GNU GPL v2, see LICENSE for more details.
"""

import pyping
import sys

if __name__ == '__main__':
    if len(sys.argv) == 2:
        pyping.ping(sys.argv[1], timeout=1000, packet_size=55, count=3, quiet_output=False)
    else:
        print "Error: call pyping domain.tld"