Pycharm: run only part of my Python file

后端 未结 5 943
逝去的感伤
逝去的感伤 2020-12-02 06:07

Is it possible to run only a part of a program in PyCharm?

In other editors there is something like a cell which I can run, but I can\'t find such an option in PyCha

5条回答
  •  情歌与酒
    2020-12-02 06:54

    You can set a breakpoint, and then just open the debug console. So, the first thing you need to turn on your debug console:

    enter image description here

    After you've enabled, set a break-point to where you want it to:

    enter image description here

    After you're done setting the break-point:

    enter image description here

    Once that has been completed:

    enter image description here

提交回复
热议问题