VSCodeでPythonをデバッグしたい
はじめに
Windows環境で、Visual Studio CodeでPythonをデバッグしたいと思います。
環境
- Windows 10 (version 1809)
- Python version : 3.7.1
- IDE : Visual Studio Code
- Version : 1.31.1
方法
- Visual Studio Codeをインストールします
- Pythonをインストールします
- Visual Studio Code上で、Ctrl + Shift + Pでコマンドパレットを開きます
- タスク : タスクの構成を選択
- 更に一覧が出てくるので「Others 任意の外部コマンドを実行する例」を選択
- tasks.jsonファイルを以下のように修正
tasks.json
{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "python", "type": "shell", "group": { "kind": "build", "isDefault": true }, "command": "python", "args": [ "${file}" ], "presentation": { "echo": false, "reveal": "always", "focus": false, "panel": "shared" }, "problemMatcher": [] } ] }
最後に、F5で実行します
参考文献
- VSCodeでPythonをデバッグしたい