Here is a basic how-to create python plugins in Maya. I find this tutorial very informative and covers very concisely on creating plugins.