I would like to connect to my wifi network using python. I know the SSID and the key for the network, and it's encrypted in WPA2 security. I have seen some libraries like wireless and pywifi but the first didn't work and the second was too complicated. What is the simpelest way to connect to wifi? what is the best library/way?
My failed code using wireless library (I've installed it via pip, of course):
from wireless import Wireless
wire = Wireless()
wire.connect(ssid='myhome',password='password')
interpreter output:
Traceback (most recent call last):
File "C:/Users/Aviv/PycharmProjects/Networks/WiFi/1/1.py", line 4, in
<module>
wire = Wireless()
File "C:\Python27\lib\site-packages\wireless\Wireless.py", line 23, in
__init__
self._driver_name = self._detectDriver()
File "C:\Python27\lib\site-packages\wireless\Wireless.py", line 50, in
_detectDriver
compare = self.vercmp(ver, "0.9.9.0")
File "C:\Python27\lib\site-packages\wireless\Wireless.py", line 71, in vercmp
return cmp(normalize(actual), normalize(test))
File "C:\Python27\lib\site-packages\wireless\Wireless.py", line 70, in
normalize
return [int(x) for x in re.sub(r'(\.0+)*$', '', v).split(".")]
ValueError: invalid literal for int() with base 10: 'file'
Ubuntu 16.04
it's working! – Hebron