Python无法直接访问您的Wifi适配器,但Windows可以。因此,您可以使用
os模块运行命令提示符代码并控制wifi适配器。
获取接口名称
然后,您可以使用名称运行开/关命令
# Get the interface name using this script.
import os
os.system(“netsh interface show interface”)
然后
Wifi在此脚本中将其替换为开始。
import os def enable(): os.system("netsh interface set interface 'Wifi' enabled")def disable(): os.system("netsh interface set interface 'Wifi' disabled")


