How do I pass variable when using Python subprocess module
问题 I'm trying to use python Subprocess module to enable/disable Ethernet connection from python code. Below is my code in which the first step is looking for the available "Ethernet Connections" and the next step enables/disables the ethernet connection according to the parameter passed in "%interfaces%". for /f "skip=2 tokens=3*" %%A in ('netsh interface show interface') do set interface=%%B netsh interface set interface %interface% ENABLED Now when using in python I couldn't pass the variable,