Debugging Python Scripts in MapInfo Pro - MapInfo_Pro - 2023

MapInfo Pro Help

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapInfo Pro
Version
2023
ft:locale
en-US
Product name
MapInfo Pro
ft:title
MapInfo Pro Help
First publish date
1985
ft:lastEdition
2023-09-12
ft:lastPublication
2023-09-12T16:39:16.995000
  1. In VSCODE open the folder where your python script is located and then open the python script file from VSCODE Explorer.
  2. Add the following lines near the top of your script. It is fine to have comments above them.
    from mi_py_debugger import *
    pro = attach_debugger()
  3. Run the python script (.py) in MapInfo Pro. You will notice a wait cursor denoting that the process in waiting for some debugger to attach to it.

  4. Switch to Debug View in VS Code, and select Python: Attach configuration.

  5. Start the VS Code debugger using the modified Python Attach configuration. VS Code should stop on your locally-set breakpoints, allowing you to step through the code, examine variables, and perform all other debugging actions. Expressions that you enter in the Debug Console are run on the remote computer as well.

  6. Start the VS Code debugger using the modified Python Attach configuration. VS Code should stop on your locally-set breakpoints, allowing you to step through the code, examine variables, and perform all other debugging actions. Expressions that you enter in the Debug Console are run on the remote computer as well.

  7. During remote debugging, the debugging toolbar appears. On this toolbar, the disconnect button (Shift+F5 ) stops the debugger and allows the remote program to run to completion.