タグ

関連タグで絞り込む (2)

タグの絞り込みを解除

pythonとデバッグに関するene0kcalのブックマーク (2)

  • Ultimate Guide to Python Debugging

    Even if you write clear and readable code, even if you cover your code with tests, even if you are very experienced developer, weird bugs will inevitably appear and you will need to debug them in some way. Lots of people resort to just using bunch of print statements to see what's happening in their code. This approach is far from ideal and there are much better ways to find out what's wrong with

    Ultimate Guide to Python Debugging
  • 【Python】いつまでprintデバッグで消耗してるの? - らっちゃいブログ

    Python を初めて間もない頃、自分も print デバッグしてました。効率の悪さを認識しつつも、IDEを導入してデバッグする方法を調べてセッティングして、という手順が面倒でずっと放置してました。 // 普段は vim で開発してます そうこうしてたら print デバッグではどうにもならないバグにぶち当たり、仕方なくデバッグポイントを置く方法を調べたわけです。するとどうでしょう。 ソースコード中に以下の一文を入れるだけではないですか。 import pdb; pdb.set_trace() たったこれだけで、上の一文を挿入した行で処理が停止し、コンソール上でステップ実行が出来るようになります。最高かよ。 個人的にですが、デバッガー起動中によく使うコマンドとしては以下です。 コマンド 説明 s(tep) ステップイン n(ext) ステップオーバー r(eturn) ステップアウト l(

    【Python】いつまでprintデバッグで消耗してるの? - らっちゃいブログ
  • 1