Search code examples
pythonpycharm

How to run code block and move to next code block/line in PyCharm?


In RStudio, you can place your cursor anywhere in a code block, hit Ctrl+Enter, and it will run it and place the cursor at the start of the next code block. This makes running code much more efficient for me. How do I do this same thing in PyCharm for Python as well?


Solution

  • For running blocks of code, Jupyter notebooks are probably the best solution: https://jupyter.org

    Another solution would be to use a debugger. Not really designed for this purpose, but it might be useful for you: https://www.jetbrains.com/help/pycharm/debugging-your-first-python-application.html#where-is-the-problem