使用python -i参数

添加-i参数

python -i myapp.py

使用`code.interact()`

    import code
    # before
    code.interact()
    # after

使用pdb lib

for thing in set_of_things:
    import pdb;
    pdb.set_trace()
    do_stuff_to(thing)

使用IPython embed

from IPython import embed

for thing in set_of_things:
  embed()
  do_stuff_to(thing)

本条目发布于[2019年6月21日](https://c4ys.com/archives/1830 "15:03")。属于[Python](https://c4ys.com/archives/category/python)分类,被贴了 [IPython](pdb(https://c4ys.com/archives/tag/pdb) 标签。