How can I start the python console within a program (for easy debugging)?

前端 未结 6 1632
说谎
说谎 2021-02-10 03:52

After years of research programming in Matlab, I miss the way I could pause a program mid-execution and inspect the variables, do plotting, save/modify data, etc. via the intera

6条回答
  •  伪装坚强ぢ
    2021-02-10 04:43

    Check out the Python debugger. In short, you can insert

    import pdb; pdb.set_trace()
    

    at any point in your program that you want to debug. (Note that you should remove these in release versions!)

提交回复
热议问题