0
2
お題は不問!Qiita Engineer Festa 2024で記事投稿!
Qiita Engineer Festa20242024年7月17日まで開催中!

会社の先輩にVScodeかCursorを使ってMacのローカルでPythonのスクリプトをデバッグ実行する方法を教わった体験記

Posted at

概要

会社の先輩にVScodeかCursorのエディタを使ってMacのローカルにあるPythonのスクリプトをデバッグ実行する方法を教わったので体験記としてまとめる。

前提

  • 下記の内容が完了していること

  • デバッグ実行は上記の記事で定義しているtest.pyを用いる

方法

  1. VScode もしくは Cursorにて「Python Debugger」という拡張パッケージをインストール(おそらくPython Debuggerを入れるとPythonの拡張機能も勝手に入るはず。)

    CleanShot 2024-07-13 at 09.34.20@2x.png

  2. エディタでtest.pyのファイルを展開しておく

    CleanShot 2024-07-13 at 09.36.20@2x.png

  3. サイドバーで「実行とデバッグ」をクリック

    CleanShot 2024-07-13 at 09.36.54@2x.png

  4. 「実行とデバッグ」をクリック

    CleanShot 2024-07-13 at 09.38.20@2x.png

  5. デバッガーの選択で「Python Debugger」を選択

    CleanShot 2024-07-13 at 09.40.25@2x.png

  6. 「Python ファイル 現在アクティブなPythonファイルをでバッグする」をクリック

    CleanShot 2024-07-13 at 09.41.27@2x.png

  7. 4行目にブレークポイントを設定

    CleanShot 2024-07-13 at 09.49.10@2x.png

  8. 「実行とデバッグ」をクリック

    CleanShot 2024-07-13 at 09.51.01@2x.png

  9. 下記の様にブレークポイントで処理が停止すれば設定は成功

    CleanShot 2024-07-13 at 09.52.13@2x.png

0
2
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
0
2