import socket, struct ipentrante = socket.inet_aton(ip) iplong = struct.unpack("!L", ipentrante)[0]
ip = socket.inet_ntoa(struct.pack('!L', iplong))