network parameters

Sybren Stuvel sybrenUSE at YOURthirdtower.com.imagination
Wed Sep 14 12:35:29 EDT 2005


le dahut enlightened us with:
> Is there a way to get network parameters (number of network
> interfaces, ip address(es), DNS, gateway) on a linux station using
> python 2.3 ?

Sure.

- number of network interfaces, ip address(es), gateway: read from /proc
- DNS: read /etc/resolv.conf

Sybren
-- 
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself? 
                                             Frank Zappa



More information about the Python-list mailing list