Assigning Materials by vertex group.

Hi all. If anyone can help with the following problem, I would most appreciate it:

I have a mesh which has been created from a set of point data, and from which value at any given point is used to generate a colour map which needs to be applied to the mesh… so…

have mesh, have object, I even have the vertex groups (more or less) properly assigned - such that once the script completes, I can go into edit mode, select a vertex group, and it grabs the points I want…

also, I have created the same number of materials as vertex groups, and I wish to assign a material to each vertex group so that the object will be colour mapped… now I know it would be possible to do a UV map (I’d even consider it but for lack of time to understand this all), but right now I’m trying to apply materials… the problem and question is: How can I now go through my mesh and assign the right materials to the appropriate faces - the vertex group grabs vertices, but materials are applied by face… the funny thing is, when I select the vertex group at the python interactive prompt, then go into edit mode and back out again, the faces are then, and only then selected… if I don’t go into edit mode, the vertices will be selected, but not the faces that they surround… and this doesn’t work from the script… any suggestions? Cheers.

Roland