Kaggle Notebook で pdb を(無理矢理)使う方法
Kaggle Notebook ではインタラクティブなシェルが利用できないため、pdbを使うことができません。
ですが、pdbのコマンドをあらかじめテキストファイルに保存しておき、catで標準入力として対象のプログラムに渡すことでデバッグができます。
/tmp/pdb.txt
b hoge.py:258
c
p var
c
%%bash
conda env my_env
cat /tmp/pdb.txt | python -m pdb /tmp/evaluate.py
普通は %debug
マジック関数を使うと思いますが、Cell上でなくスクリプトとしてpythonを実行しなければならない場合に上記の方法が役立ちます。
Author And Source
この問題について(Kaggle Notebook で pdb を(無理矢理)使う方法), 我々は、より多くの情報をここで見つけました https://qiita.com/bilzard/items/1d355e12cd209e604e39著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .