code: def send_one_ping(mySocket, destIP, myID, mySeqNumber, packet_size):
      
      #destIP  =  socket.gethostbyname(destIP)
  
      # Header is type (8), code (8), checksum (16), id (16), sequence (16)
      # (packet_size - 8) - Remove header size from packet size
      myChecksum = 0
  
      # Make a dummy heder with a 0 checksum.
      header = struct.pack(
          "!BBHHH", ICMP_ECHO, 0, myChecksum, myID, mySeqNumber
      )
  
      padBytes = []
      startVal = 0x42
      # 'cose of the string/byte changes in python 2/3 we have
      # to build the data differnely for different version
      # or it will make packets with unexpected size.
      if sys.version[:1] == '2':
          bytes = struct.calcsize("d")
          data = ((packet_size - 8) - bytes) * "Q"
          data = struct.pack("d", default_timer()) + data
      else:
          for i in range(startVal, startVal + (packet_size-8)):
              padBytes += [(i & 0xff)]  # Keep chars in the 0-255 range
          #data = bytes(padBytes)
          data = bytearray(padBytes)
  
  
      # Calculate the checksum on the data and the dummy header.
      myChecksum = checksum(header + data) # Checksum is in network order
  
      # Now that we have the right checksum, we put that in. It's just easier
      # to make up a new header than to stuff it into the dummy.
      header = struct.pack(
          "!BBHHH", ICMP_ECHO, 0, myChecksum, myID, mySeqNumber
      )
  
      packet = header + data
  
      sendTime = default_timer()
  
      try:
          mySocket.sendto(packet, (destIP, 1)) # Port number is irrelevant for ICMP
      except socket.error as e:
          print("General failure (%s)" % (e.args[1]))
          return
  
      return sendTime
docs: Send one ping to the given >destIP<.