LoginSignup
1
0

PythonのVSCodeのデバッグ構成についての備忘録

Last updated at Posted at 2022-09-27

「実行とデバッグ」のタブメニューより、
「launch.jsonを作成」で自動生成できるが痒い部分をカスタマイズ

launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            // デバッグ構成の表示名
            "name": "Python: 表示名",
            "type": "python",
            "request": "launch",
            // デバッグしたいファイル名を設定しておけば開いていなくともF5でデバッグ可
            "program": "hoge.py",
            // 外部コンソールでデバッグ
            "console": "externalTerminal",
            "justMyCode": true,
            // 作業ディレクトリの指定
            "cwd": "hoge/fuga/HogeHogeProject"
            // 仮想環境などの場合に任意のpython実行ファイルを指定可能
            "python": "C:/hoge/fuga/python.exe"
        }
    ]
}
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0