How to run only part of the code in PyCharm, having some data in operating memory In Jupyter Notebook I have blocks of Python code and I can run them arbitrarily. What is super cool about that is I can spend 10 minutes training some ML model and then play around with it, without the need to run the training process again and again.
How can I achieve something similar using PyCharm? While I like this feature in Jupyter it is so less convenient to write code.
Pycharm allows you to highlight a section of run and execute that specific section in the console by right-clicking and choosing 'Execute selection in Python Console'. This section of code has now been executed and any variables you've defined are now stored in memory.
You can continue executing pieces of code in this way and reference objects previously created up until you refresh the console session.