| Not Working In Subprocess.call
问题 Whenever I use a command in a subprocess with "|" in it doesn't work it has an output of Command "|" is unknown, try "in link help". Or when I put this: #!/usr/bin/python from subprocess import call from shlex import split interface = call(split("ip -o link show | awk '{print $2}' | grep wl")) It is giving the output of: Error: either "dev" is duplicate, or "awk" is a garbage. 回答1: You can use subprocess.check_output method and Popen class though I wasn't able to chain both pipe operations.