简体   繁体   English

简单的Python程序,可通过用户输入凭据连接到安全的wifi网络

[英]Simple Python program to connect to a secure wifi network with user input credentials

My question I guess is: Is this possible without shelling out to command line and without 3rd party Python packages? 我猜我的问题是:是否可以在不使用命令行的情况下且没有第三方Python包? I can't seem to find any native Python commands to manipulate or configure a wireless network connection. 我似乎找不到任何本地Python命令来操纵或配置无线网络连接。 I know there are already built-in 'netsh wlan' commands in Windows 7, but would rather this all be in python. 我知道Windows 7中已经内置了“ netsh wlan”命令,但宁愿全部使用python。 I am also confused by the logistics of this operation. 我也对这项行动的后勤感到困惑。 With the netsh stuff, you still are required to have a wireless profile xml file specified in the command. 使用netsh时,仍然需要在命令中指定无线配置文件xml文件。 My current image doesn't have any wireless profiles and I do not really understand the purpose of that if you are connecting to a brand new network. 我当前的图像没有任何无线配置文件,并且如果您要连接到全新的网络,则我不太了解其用途。 Why is this not automatically generated when you connect? 为什么在连接时不会自动生成?


A little bit about the network 关于网络的一点点

Network type: Infrastructure 网络类型:基础架构

Authentication: WPA2-Enterprise 认证:WPA2-Enterprise

Encryption: CCMP 加密:CCMP


The ultimate goal is to have a script that my users can just launch, put in their credentials, and never see the multiple Windows dialogues while doing so. 最终目标是拥有一个脚本,我的用户可以启动该脚本,输入其凭据,而在执行过程中从不看到多个Windows对话框。 I'm not asking for someone to write this for me. 我不是要别人为我写这篇文章。 That's what I'm suppose to do. 那就是我应该做的。 I just need to know if anyone has successfully done something like this in strictly Python or point me in the right direction. 我只需要知道是否有人在严格的Python中成功完成了这样的事情,或者指出了正确的方向。 Thanks! 谢谢!

No. Python standard library doesn't ship with any functionality to control platform-specific functionality like wireless adapters. 否。Python标准库不附带任何功能来控制特定于平台的功能,例如无线适配器。 You have to invoke the tools shipped with the platform, find some 3rd party libraries that control this functionality, or write your own such libraries. 您必须调用平台随附的工具,找到一些控制此功能的第三方库,或编写自己的此类库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM