swap materials in cycles

Once in a while i create 3D objects, and duplicates.
To discover that i want the duplicate to have some materials swapped for others.
I didnt make vertexgroups (or colorvertex groups), and the selection which was once made to assign materials.
Isnt available in the model, though the model has multiple sets of materials assigned, so its known to the duplicate model.

Is there a way to swap those those materials for others, maybe by GUI or by some python scripting ?.
Leaving the original model wich its own materials.
(so maybe convert to vertex group, select the group and then assign a new material or something like that)

There is a GUI way: in edit mode select the material slot and then click “Select” button under the material list, this will select all faces to which that material is assigned. Note that this will add to your existing selection (i.e. you’ll likely need to deselect everything first).