Error permission denied in python

Asked

Viewed 128 times

2

I was writing a code to try to connect to my wi-fi network using python. I used the following code:

from wi - fi
import Cell, Scheme

try:

cell = Cell.all('wlan0')

except:

  print(Exception)

passkey = 'pass'

try:

scheme = Scheme.for_cell('wlan0', 'nome da rede', cell, passkey)
scheme.save()
scheme.activate()

except:

  print(Exception)

This code receives an error in the first exception:

[Errno 13] Permission denied: '/sbin/iwlist'

I ran as root and in the first exception was sent another error code:

[Errno 2] No such file or directory: '/sbin/iwlist':  '/sbin/iwlist'
  • 1

    Already tried to run your program in Administrator mode ?

  • Yes. I typed in the mobile termux the command "sudo python program.py" without the Apas

  • 1

    install the wireless-tools package

  • How it would help me???

  • 1

    for there to be the iwlist this package needs to be installed

  • I just installed using apt-get install iwlist, it was installed but it did not work

  • sbin, are root files, is the system can only get access if you have permission.. you used the user to run the file and it seems that it did not turn out very well, check if this program is in sbin... ls /sbin | grep parted . and allow the file to run... chmod +x program.py and see the return of it.

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.