This question already has an answer here:
I want to change the style of the polygon contained in the vector layer. Is there any API available?
(I can click the properties of the shapefile, then select the style and change the symbol properties, but I want to do this programmatically.)
I am using Python to customise QGIS.