def printConnections(switches):
 for sw in switches:
  output(('%s: ' % sw))
  for intf in sw.intfList():
   link = intf.link
   if link:
    (intf1, intf2) = (link.intf1, link.intf2)
    remote = (intf1 if (intf1.node != sw) else intf2)
    output(('%s(%s) ' % (remote.node, sw.ports[intf])))
  output('\n')

def printConnections ( switches ) : for sw in switches : output ( ( '%s: ' % sw ) ) for intf in sw . intfList ( ) : link = intf . link if link : ( intf1 , intf2 ) = ( link . intf1 , link . intf2 ) remote = ( intf1 if ( intf1 . node != sw ) else intf2 ) output ( ( '%s(%s) ' % ( remote . node , sw . ports [ intf ] ) ) ) output ( '\n' )
compactly print connected nodes to each switch .