1

I am trying to write a script will return scan results similar to that of iw/iwlist. Currently I am using a subprocess and using iw.

When using the command

sudo iw wlan0 scan | egrep "SSID|signal|freq|channel" 

I can get the information I need but parsing the results is a bit cumbersome. The aim of the script is to get these characteristics for all of the wifi signals picked up by the wifi card.

Is there was a python module that could get the SSID, rssi (signal), frequency and channel without having to use a subprocess and parse the results manually.

  • Does `/proc/net/wireless` contain the information you need? – jordanm Jan 11 '20 at 20:17
  • 1
    Does this help? https://stackoverflow.com/questions/39679421/python-scan-for-wifi – tink Jan 11 '20 at 20:30
  • This is explicitly off topic. Please see: [help/on-topic]. – AMC Jan 11 '20 at 20:45
  • "best" is subjective. I would say that your way of using subprocess + native tools is already the "best" way, since it ensures compatibility with your system and you can get exactly what you need. There are a number of wifi-related modules for Python but they are platform-specific or not updated anymore. – Gino Mempin Jan 13 '20 at 12:51

0 Answers0