"kode4u" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> How to use python get my windows box's ip setting type? Dynamic ip, or
> static ip?
>
> If it's static ip, what's the exact value?
>

You can use WMI to list properties of your network adapter(s):
import win32com.client
wmi=win32com.client.GetObject('winmgmts:')
adapters=wmi.InstancesOf('Win32_NetworkAdapterConfiguration')
for adapter in adapters:
    print adapter.Properties_['Caption'], adapter.Properties_['DhcpEnabled'], 
adapter.Properties_['IpAddress']

       Roger




----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet 
News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 
Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to