> [2] http://code.google.com/p/python-ifconfig/
>>
>
Probe con esta url, la cual me llevo a otro enlace y al final llegue a este
pequeño codigo. Que me dice precisamente lo que quiero asi que de 10,
gracias :)

def get_ip_address(ifname="wlan0"):
   try:
      s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
      return socket.inet_ntoa(fcntl.ioctl(
         s.fileno(),
         0x8915,
         struct.pack('256s', ifname[:15])
      )[20:24])
   except:
      return "La interfaz no está conectada a ninguna red"

-- 
Matt's
_______________________________________________
Python-es mailing list
Python-es@python.org
http://mail.python.org/mailman/listinfo/python-es
FAQ: http://python-es-faq.wikidot.com/

Responder a