If you have Microsoft Visual Studio, you can use it to debug an IronPython script that is running.
For example, to debug an extension running in Mechanical:
Ensure that debug mode is enabled.
Start Visual Studio.
For the Attach to field, verify that the code type Managed (v.4.0) is selected.
Attach the process
AnsysWBU.exe
.Open your IronPython script and set your breakpoints.
Refer to Microsoft Visual Studio documentation for information on using this program to debug your script.