Giuseppe non lo cerco in locale ma su macchine remote! C'è pure scritto
nella domanda.
Magari era così facile.
Federico
On Mon, 25 Nov 2013 09:47:29 +0100, Giuseppe De Marco
<demarco...@gmail.com> wrote:
import socket
socket.gethostbyname(socket.gethostname())
oppure fai un comando di sistema (subprocess.Popen), fetchi l'output,
e con le regexp di python trovi tutto.
Fai prima una findall eppoi un match con gruppi assegnati e ti
ritrovi un dizionario che puoi trasformare in oggetto o in cosa
desideri meglio.
2013/11/24 Nemesis
Ritorna la questione,
guardate i commenti a questa domanda su stackoverflow:
http://stackoverflow.com/questions/20177686/python-parser-for-unix-ip-address-command-iproute2
[2]
In particolare questo commento:
_"One more thing though: Your friends are totally right about
iproute2 being the future. But on many systems, particularly embedded
ones, you're still more likely to encounter the good old ifconfig,
the
iproute2 package might not be installed. So if you want to make your
abstraction layer portable, you'll probably have to account for both.
– Lukas Graf"_
Mi sa che tocca ingegnarsi di più.
Federico
_______________________________________________
Wireless mailing list
Wireless@ml.ninux.org [3]
http://ml.ninux.org/mailman/listinfo/wireless [4]
Links:
------
[1] mailto:neme...@ninux.org
[2]
http://stackoverflow.com/questions/20177686/python-parser-for-unix-ip-address-command-iproute2
[3] mailto:Wireless@ml.ninux.org
[4] http://ml.ninux.org/mailman/listinfo/wireless
_______________________________________________
Wireless mailing list
Wireless@ml.ninux.org
http://ml.ninux.org/mailman/listinfo/wireless