Search code examples
pythonpycharm

How to run only block of code in PyCharm like in Spyder?


In Spyder I can run only a part of code without running everything. I know that in PyCharm I can click right mouse button and "Execute Selection in Console", but it will be new execution without values and variables which declared before this part of code. So, very often I need to run only few last lines of my code, with parametres and options that I already have.


Solution

  • you can try to use the interactive interpreter while in debug mode. I find it to be very useful when trying to run code snippets in the program. view the screenshot below.

    enter image description here