In python if I have interfaces = netifaces.interfaces() which is a list returning: ['lo','eth0','eth1']
how to I loop over that list passing lo and eth0, eth1 into several subprocess calls to ethtool?
subprocess.call(['ethtool %'] interfaces) --- lo
subprocess.call(['ethtool %'] interfaces) --- eth0
subprocess.call(['ethtool %'] interfaces) --- eth1
I want to run ethtool for the number of items in my interfaces list but for each pass I want to substitute the next item in the interfaces list and pass that to the subprocess.call.
callis a list of arguments. So just provide interface as the second item in the list.