How do I connect/disconnect/configure a wireless n

2019-04-28 21:21发布

I'm looking to see if there is a way to connect or disconnect to a wireless network in python, preferably a way that would work for both public and secured networks if I supplied the password. If I can configure the options about wireless, that would be an added bonus (ex. see all networks in range, see information about networks in range (like encryption type)). I run a windows computer, so I see many answers to this question in Linux, or other operating systems, but none in windows. Thanks in advance.

1条回答
成全新的幸福
2楼-- · 2019-04-28 21:34

You'll probably have to use one of the DLLs in windows for that. Using ctypes you can get access to the win32 API from Python.

It looks like the functions from wlanapi.dll, starting with WlanOpenHandle and WlanEnumInterfaces might do what you want.

Edit: For example code, see the accepted answer to this.

查看更多
登录 后发表回答