drop into python interpreter while executing function

后端 未结 3 1637
耶瑟儿~
耶瑟儿~ 2020-12-07 07:39

i have a python module with a function:

def do_stuff(param1 = \'a\'):
    if type(param1) == int:
        # enter python interpreter here
        do_somethin         


        
3条回答
  •  粉色の甜心
    2020-12-07 08:33

    Inserting

    import pdb; pdb.set_trace()
    

    will enter the python debugger at that point

    See here: http://docs.python.org/library/pdb.html

提交回复
热议问题