import wmi
c = wmi.WMI()
o = c.query("select * from Win32_NetworkAdapter where NetConnectionID='wifi'")[
    0]
o.EnableDevice(1)
How to programmatically enable/disable network interfaces? (Windows XP)