code: def getWeights(self, fromName, toName):
          
          for connection in self.connections:
              if connection.fromLayer.name == fromName and \
                 connection.toLayer.name == toName:
                  return connection.weight
          raise NetworkError('Connection was not found.', (fromName, toName))
docs: Gets the weights of the connection between two layers (argument strings).