code: def setWeight(self, fromName, fromPos, toName, toPos, value):
          
          for connection in self.connections:
              if connection.fromLayer.name == fromName and \
                 connection.toLayer.name == toName:
                  connection.weight[fromPos][toPos] = value
                  return value
          raise NetworkError('Connection was not found.', (fromName, toName))
docs: Sets the weight of the connection between two layers (argument strings).