def ip_numstr_to_quad(num):
 n = int(num)
 packed = struct.pack('>L', n)
 bytes = struct.unpack('BBBB', packed)
 return '.'.join(map(str, bytes))

def ip_numstr_to_quad ( num ) : n = int ( num ) packed = struct . pack ( '>L' , n ) bytes = struct . unpack ( 'BBBB' , packed ) return '.' . join ( map ( str , bytes ) )
convert an ip number as an integer given in ascii representation to an ip address string .