I try to execute linux command in Python, but I don't get any output and any error.
import subprocess, os
cmd = ["iwconfig", "wlan0", "|", "grep", "ESSID", "|", "awk", "-F:", "'{print $2}'", "|", "sed", "'s/\"//g'"]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = proc.communicate()
print(output.decode("ascii"))
The output should be the ESSID of connected Wi-Fi.
I am sorry, I read the other questions, but I can't get it.