How to run code line by line in pycharm community edition

How do i run codes in pycharm community edition 2022.3.2…

I selected the code but no option to run line by line…pls help

That would be in the debugger. But I haven’t learned that yet.

  1. Here’s a Jetbrains page on the debugger: Part 1. Debugging Python Code | PyCharm Documentation
  2. And a search for more pages for you. LMGTFY (I’m not trying to be snarky, I thought it was cute.) :slight_smile:

You can “step through” code but there are 2 types of steps:

  1. Step over a function (do not enter it)
  2. Step into a function (go right into it)

There are normally 2 different keystrokes to do that.


is there a particular reason for wanting to use PyCharm? Is it required?

If not, I recommend Spyder. It is very user friendly.

Home — Spyder IDE (

1 Like

Apparently there is such a way in PyCharm.

However, I’d have to say, I’d have to agree with the posters there that I don’t really understand why they made such a simple task so needlessly complicated, other than the fact that PyCharm is aimed squarely at experienced professional developers of large, complex codebases, rather than the types of code where this feature would be more useful. It’s an incredibly powerful tool for that, but if you’re a newer user, not a professional programmer or interested in interactive execution, you might want to consider alternatives.

As another user mentioned, Spyder is particularly well suited to that; it can run code by line, selection, cell or file, as well as interactively in its IPython console, and has a Variable Explorer pane showing you the values of your variables in real time, as well as a debugger like PyCharm. Of course, I’m open source maintainer of it, so I might be slightly biased :smiley: VSCode is very popular and also has the feature you mentioned, though it is more general purpose and doesn’t lean into supporting interactive execution nearly as much as Spyder.

Thanks , spyder and vscode both worked.