How can I debug Python 3 code in Visual Studio Code?

后端 未结 6 596
没有蜡笔的小新
没有蜡笔的小新 2020-12-15 04:38

I want to debug a project written in Python 3 in Visual Studio Code, but I can\'t seem to find any way of specifying interpreter or Python version in the launch.json file.

6条回答
  •  一个人的身影
    2020-12-15 05:19

    There is a setting trigger within the setting file:

    For Python default (which is 2.7 for now)

    "python.pythonPath": "python",
    

    For Python 3:

    "python.pythonPath": "python3",
    

    Use the following command to check the Python version:

    import sys
      print(sys.version)
    

提交回复
热议问题