How do I connect/disconnect/configure a wireless network in python?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 05:11:52

问题


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:


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.



来源:https://stackoverflow.com/questions/12126744/how-do-i-connect-disconnect-configure-a-wireless-network-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!