Setup Python Debugging using Visual Studio Code (VSCODE) - 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. Install the Python and pylint extensions and restart VSCODE.
  2. Initialize configurations. A configuration drives VS Code's behavior during a debugging session. Configurations are defined in a launch.json file that's stored in a .vscode folder in your workspace.
  3. To initialize debug configurations, first select the Debug View in the sidebar. If you don't yet have any configurations defined, you'll see "No Configurations" in the drop-down list, and a dot on the settings icon.
  4. To generate a launch.json file with Python configurations:
    • Select the Settings button or use the Debug > Open configurations menu command.
    • In the Select Environment drop-down list that appears, select Python.
    The Python extension then creates and opens a launch.json file that contains number of pre-defined configurations. You can modify configurations (to add arguments, for example), and also add custom configurations.
    Python: Attach or Python: Remote Attach configuration must be defined like this.
                                {
                                "name": "Python: Remote Attach",
                                "type": "python",
                                "request": "attach",
                                "port": 5678,
                                "host": "localhost",
                                "pathMappings": [
                                {
                                "localRoot": "${workspaceFolder}",
                                "remoteRoot": "${workspaceFolder}"
                                }
                                ]
                                }
  5. After the initial configuration is done, setup VSCODE for remote debugging.
    • Install ptvsd using python -m pip install --upgrade ptvsd into your environment.
    • For debuggingm the default Port for the ptvsd use is 5678. You may need to open the port for debugging in the appropriate firewall or other networking configuration.

    For debuggingm the default Port for the ptvsd use is 5678. You may need to open the port for debugging in the appropriate firewall or other networking configuration.

    For more details refer to VSCODE python debugging : https://code.visualstudio.com/docs/python/debugging