Python subprocess arguments | Sololearn: Learn to code for FREE!

0

Python subprocess arguments

How do I use variable inside subprocess arguments like: iface = "wlan1" cmd = subprocess.run(['iwconfig ' + iface + "' | grep 'Mode' '"] ) it's giving me errors

8/7/2022 10:27:58 PM

Karol Trawa

1 Answer

New Answer

+1

What errors? And it may be the arguments supplied it should be a list of them all seperately. Also, check this out: https://stackoverflow.com/questions/13332268/how-to-use-subprocess-command-with-pipes