Before you can write more complex commands, you have to know how to properly register them with Maya. The MFnPlugin is a class used for registering the command with Maya.
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Please see the Autodesk Creative Commons FAQ for more information.