[107141] in North American Network Operators' Group

home help back first fref pref prev next nref lref last post

Re: interger to I P address

daemon@ATHENA.MIT.EDU (Colin Alston)
Wed Aug 27 10:04:38 2008

Date: Wed, 27 Aug 2008 16:04:29 +0200
From: Colin Alston <karnaugh@karnaugh.za.net>
To: "Robert D. Scott" <robert@ufl.edu>
In-Reply-To: <013101c9084c$9568a650$c039f2f0$@edu>
Cc: nanog@nanog.org
Errors-To: nanog-bounces@nanog.org

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'



home help back first fref pref prev next nref lref last post