North American Network Operators Group

Date Prev | Date Next | Date Index | Thread Index | Author Index | Historical

Re: interger to I P address

  • From: Colin Alston
  • Date: Wed Aug 27 10:04:40 2008

Robert D. Scott wrote:
The harder way:

Decimal: 1089055123
Hex (dashes inserted at octals): 40-E9-A9-93
Decimal (of each octet): 64-233-169-147
IP Address: 64.233.169.147

The Python way


>>> import socket, struct
>>> socket.inet_ntoa(struct.pack('>l', 1089055123))
'64.233.169.147'