1. Copy the wingdbstub.py from the Wing IDE installation directory to the Maya Python script path. 2. Make sure that enable passive listening is selected in the Wing IDE > Edit > Preferences > Debugger to allow connections from external processes. Windows may pop up a dialog box requesting authorization to open the communication port. You should allow this situation. 3. Start Maya and make sure that the Python script can be successfully imported and run. 4. In the Wing IDE, open the same script. Use the F9 key or click leftmost to set breakpoints. 5. In Maya, execute the Python statement
Import Wingdbstub
Windows may pop up another authorization dialog box, requesting authorization. You should allow this situation.
6. Check in the wing IDE; the status indicator in the lower left of the Wing IDE's main window should be green. This indicates that a remote debugging connection has been established and Maya is running. 7. In Maya, call the Python function that contains the breakpoint. When the breakpoint is reached, the status indicator turns yellow to indicate that Maya is paused. The next line of code to be executed will be highlighted by the red line. 8. You can now check the status of your program using all the debugging features of the Wing IDE. Press the F5 key or the Green Play button to return control to Maya.
Using the Wing IDE with Maya (excerpt from the Maya User Guide)