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

7th Aug 2022, 10:27 PM
Karol Trawa
Karol Trawa - avatar
1 Odpowiedź
+ 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
7th Aug 2022, 10:42 PM
Slick
Slick - avatar