profile.key = password # use generated password
iface.remove_all_network_profiles() # remove all the profiles which are previously connected to device
tmp_profile = iface.add_network_profile(profile) # add new profile
time.sleep(0.1) # if script not working change time to 1 !!!!!!
iface.connect(tmp_profile) # trying to Connect
time.sleep(0.35) # 1s
Error message
File "passcracker.py", line 63, in main
iface.remove_all_network_profiles() # remove all the profiles which are previously connected to device
NameError: name 'iface' is not defined
It comes up with this whenever i run this script
import pywifi
from pywifi import PyWiFi
from pywifi import const
from pywifi import Profile
This is the part of the code that fails
Error message
File "passcracker.py", line 63, in main
iface.remove_all_network_profiles() # remove all the profiles which are previously connected to device
NameError: name 'iface' is not defined