A First Maya command plug-in
In order to help you understand how command plug-ins work, a simple example that creates a command that prints "Hello World" in the Script Editor is presented here, with explanations. There are three versions of the code for the C++ API, the Python API 1.0, and the Python API 2.0. All the Python examples are Python 3 compliant.
The examples demonstrate the basics of plug-in writing. It also demonstrates where to save plug-ins so that they are automatically loaded by Maya, and how to build a C++ plug-in.