Generate random guns

Hello, I am trying to figure out a possible way to generate guns completely randomly, or, if that is not possible, generate them from a predefined set of parts. Can anyone offer any insight to this?

Moved from “General Forums > Blender and CG Discussions” to “Coding > Python Support” (this might also fit in Support > Modeling, please let me know if you want it moved there)