Skip to content

TPI: Debugging Python, Test launch configuration  #34

@paulacamargo25

Description

@paulacamargo25

Refs: microsoft/vscode-python#19503

Complexity: 3

Author: @paulacamargo25


Prerequisites:

  • Install python version >= 3.7
  • Install the debugpy extension.

Part 1: Debugging python file

  1. Create a python file with a simple code.
  2. Go to Run and debug, then Create a launch.json file
  3. Select Debugpy > Python File
  4. Make sure the configuration has been created correctly, that is, that the type is debugpy, the name.
  5. Run the configuration, add breakpoint, change interpreters, play around with the debug a bit, to make sure everything is correct.

Part 2: Debug with other launch configurations

  1. If you have a project in python you can try the other launch configurations. For example with Django, FastApi or Flask. Otherwise you can follow the steps here to create a simple fastApi application.
  2. Click on the Add configuration button in the launch.json, select dubugpy > FastApi.
  3. Make sure the configuration has been created correctly, that is, that the type is debugpy, the name.
  4. Run the configuration, add breakpoint, change interpreters, play around with the debug a bit, to make sure everything is correct.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions