[eside-ghost] Saber todas las IPs del PC desde Python
fmonkey
fmonkey en gmail.com
Mie Ago 13 22:02:14 CEST 2008
On Wed, Aug 13, 2008 at 7:28 PM, Saúl Ibarra <saghul en gmail.com> wrote:
> Hoola!
>
> Es verano y todo eso... espero que alguno de esos enamorados de las
> culebras ande por aquí ;)
>
> Necesito desde python sacar una lista de IPs que tiene el equipo, pero
> todas las soluciones que encuentro son usando socket y cosas con
> gethostbyname, pero eso lo hace por DNS (creo) y yo necesito que me
> diga todas, en plan lo que ponga en ifconfig :)
>
> Any help? Thnx!
>
Saúl, puedes mirarte y hacerte un cocktail con estos dos progamillas:
http://code.activestate.com/recipes/439094/
http://code.activestate.com/recipes/439093/
y aunque yo no lo he usado, existe:
python-netifaces (0.4-1) - Portable network iface information for Python
Depends: libc6 (>= 2.7-1)
Binary for arch i386 (11.7 KB) | dsc file | Source dir
netifaces provides a (hopefully portable-ish) way for Python
programmers to get access to a list of the network interfaces on the
local machine, and to obtain the addresses of those network
interfaces.
The package has been tested on Mac OS X and Windows 2000. On
Windows, it is currently not able to retrieve IPv6 addresses, owing to
shortcomings of the Windows API.
It should work on other UNIX-like systems provided they implement
either getifaddrs() or support the SIOCGIFxxx socket options, although
the data provided by the socket options is normally less complete.
http://www.tcosproject.org/debian.php
http://www.tcosproject.org/pool/main/n/netifaces/
que si lo miras y te sirve de algo, pues perfect!! ;-DDD
un saludete,
fmonkey
> --
> Saúl -- "Nunca subestimes el ancho de banda de un camión lleno de disketes."
> ----------------------------------------------------------------
> http://www.saghul.net/
> _______________________________________________
> eside-ghost mailing list
> eside-ghost en deusto.es
> https://listas.deusto.es/mailman/listinfo/eside-ghost
>
Más información sobre la lista de distribución eside-ghost