A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser.
2004年にはすでに標準ライブラリに入っていたのに「スクリプト言語でもステップ実行とかできたらいいのにね」とか言われちゃう不憫なpdbについて軽く解説。pdb不憫な子! まず適当にスクリプトを書きます。 ~$ cat t.py for i in range(10): sum += i print sum実行するとエラーになります。 ~$ python t.py Traceback (most recent call last): File "t.py", line 2, in <module> sum += i TypeError: unsupported operand type(s) for +=: 'builtin_function_or_method' and 'int'ワー、なんでエラーになったんだろー(棒読み) そこでおもむろに-m pdbをつけてステップ実行します。 ~$ p
31.1.11 Better debugging with pdbpp A short while ago I found out about an alternative to ipdb, pdbpp. among other features pdbpp offers, tab completion, syntax highlighting better code display (sticky mode). It extends pdb so import pdb;pdb.set_trace() still works. Sadly, there is a single thing one has to do to make it work with zope. When pdb fires up, it loads some third party tools, one o
みんなのIoT/みんなのPythonの著者。二子玉近く160平米の庭付き一戸建てに嫁/息子/娘/わんこと暮らしてます。月間1000万PV/150万UUのWebサービス運営中。 免責事項 プライバシーポリシー 以前pudbというCUIベースのソースコードデバッガを紹介した。コンソール環境で利用できてなかなかファンシーなのだが,デバッガをいちいち立ち上げる必要があるので少々面倒だ。今回はより手軽にCUIベースのデバッガを起動する方法を紹介する。 方法は簡単。debugというパッケージを「pip debug」などでインストール,デバッグを開始したい場所に「import debug」とするだけで,プログラムのその位置でシンタックスカラーリングの効いたファンシーなデバッガが立ち上がる。 「n」を押して実行を進めたり,print文を使って実行中の変数の中身を表示したりできる。実行中のプログラムも表示し
みんなのIoT/みんなのPythonの著者。二子玉近く160平米の庭付き一戸建てに嫁/息子/娘/わんこと暮らしてます。月間1000万PV/150万UUのWebサービス運営中。 免責事項 プライバシーポリシー pudbは,CUI環境(つまりシェル)で動くGUIライクなデバッガ。Pythonには標準でpdbというデバッガがついてくるけど,コマンドラインベースでちょっと使い方が面倒だよね。pudbはpdbよりノリがいい。まあスクリーンショットを見てもらうのが早いかな。 CUIベースでGUIっぽいことをするというのは,レトロなノリだよなあ。でもCUIベースならシェルが動く環境ならどこでも動く,という利点もある。ローカルのPythonでもssh越しのPythonでも,シェル上なら同じように動くというのは嬉しい。 インストールは簡単。いつものごとくeasy_installを使って「$ easy_ins
Using Werzeug's Debugger With AppEngine This page describes a monkeypatch to use Werkzeug's debugger in AppEngine's development server. 1. Werkzeug's Mini Templates don't work with AppEngine, so we use Jinja2. The converted templates are attached in the end of this page. Add the 'debug' dir to your project and override 'werkzeug.debug.utils', which is responsible for rendering the debugger, with o
Adventures across space and time with the Python programming language As a programmer, one of the first things that you need for serious program development is a debugger. Python has a debugger, which is available as a module called pdb (for “Python DeBugger”, naturally!). Unfortunately, most discussions of pdb are not very useful to a Python newbie — most are very terse and simply rehash the desc
Sometimes it's helpful to watch what Python the low-level details of what Python is doing. With an IDE like Wing IDE or Komodo you can step through events in a GUI. But if you're a command-line sort of person like me you can roll your own trace program using the same run-time hooks used by those IDEs The hook is set via the sys.settrace() function. This takes a function which is called during any
スクリプト言語用のデバッガの使い方 - Ruby, Python, Perl スクリプト言語用の CUIのデバッガの使い方を簡単にまとめました。対象言語は Ruby, Python, Perl です。 私は C, C++ でプログラムを書いているときはデバッガ (主に GNU/Linux 上の gdb) を頻繁に利用します。しかし、スクリプト言語ではそれほどでもありません。これはおそらく次のような理由によります。 ビルドが不要なので printf デバッグが容易 (ある程度大きい C++ のプログラムではビルド時間が長いので printf の挿入はしんどい) 異常終了時にスタックトレースが表示される (Ruby, Python なら自動、Perl の場合は use Carp; $SIG{__DIE__} = \&Carp::confess; など) オブジェクトのインスペクトが簡単 (Ru
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く