This question already has an answer here:
I would like to be able to apply and edit a material to objects I have create using python script. I am using the cycles render engine but can't find a way to get this to work.
I've tried a bunch of the answers already given in other threads but none of them seem to work.
I would like to: create and apply a new material for each object and adjust the colours using rgb, using nodes or otherwise.
Sorry if this is a stupid question, I'm very new to blender scripting!