How to control RGB color input via python script
Here is a guide to control cycles nodes with python.

So the code would look like this:

import bpy
mat = bpy.data.materials['Material_Name']
nodes = mat.node_tree.nodes
node = nodes.get("Diffuse BSDF")
# change the color
node.inputs[0].default_value = (0,1,0,1)  # green RGBA


This lets you change the value just one time and does not run in a loop like with animation nodes.