def _guess_iface_name(netif):
 with os.popen(('%s -l' % conf.prog.ifconfig)) as fdesc:
  ifaces = fdesc.readline().strip().split(' ')
 matches = [iface for iface in ifaces if iface.startswith(netif)]
 if (len(matches) == 1):
  return matches[0]
 return None

def _guess_iface_name ( netif ) : with os . popen ( ( '%s -l' % conf . prog . ifconfig ) ) as fdesc : ifaces = fdesc . readline ( ) . strip ( ) . split ( ' ' ) matches = [ iface for iface in ifaces if iface . startswith ( netif ) ] if ( len ( matches ) == 1 ) : return matches [ 0 ] return None
we attempt to guess the name of interfaces that are truncated from the output of ifconfig -l .