159
182

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Python]超便利なデバッグ

Last updated at Posted at 2017-09-06

pythonで楽にデバッグしたい方へ

pythonをコマンドラインで走らせるとき、

$ python hoge.py -m pdb

のように"-m pdb"をつけるとデバッグモードで実行してくれます。
(最近知りましたがこれだけでもめちゃ便利)

任意の場所で処理を止めたい時は・・・

Eclipseのようにブレークポイントを置きたい時は、

hoge.pyに

assert False

を挿入してデバッグモードで実行すればよいです。

assert Falseに反応してそこで止まってくれるので、あとはやりたい放題です。

短いですが以上です!

159
182
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
159
182

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?