Feature Request: Matlab-like cells and debugging with interactive console

It's great that PyCharm has incorporated IPython notebook, but, it's still a little awkward to use, especially when developing proper code at the same time.  And still, after years in Python trying every IDE, I have to say the Matlab IDE was better, BECAUSE: You could execute "cells" of code at any time.

Pycharm ALMOST has this, it's just not smoothly put together.  

Much better than incorporating notebook would be if PyCharm allowed you to
1) Split code in normal .py files into cells (with maybe a "##" or something)
2) Enter commands and execute code code in the console (in the context of a breakpoint) by either typing in an expression or selecting a cell and clicking Shift-Enter or something.

Suppose I want to stop at a breakpoint, evaluate a chunk of code, and then query the status of some internal variable that's not immediately accessible through the "Variables" window

Current Workflow:
- Stop at breakpoint
  • Highlight chunk of code
  • Open "Evaluate Expression" window
  • Press "Evaluate"
  • Go back to console/variables to check any output/state changes
  • Open "Evaluate Expression" window again
  • Query the state somehow

Desired Workflow
- Stop at breakpoint
  • Select cell containing chunk of code
  • Press Shift-Enter or something to evaluate
  • Look at console/variables to see state output/state changes.
    - Select Console
    &nbsp- Select Console
    - Query the state
The latter requires no switching between windows.  It also allows you to modify and run your code in place, rather than modify, copy-to-evaluate, modify, copy-to-evaluate that's currently required.  It merges the Console and Evaluate window into one, so you don't need to keep switching.  And unlike IPython notebook, it allows you to cement your interactive changes into permanent code in py files.
1 comment
Comment actions Permalink
I just discovered "Execute Selection In Console" which is kind of close, but it's useless for debugging because it (a) Executes in a console in some other weird namespace, not the frame you're debugging in, (b) Always gives an indent error if you're in a function, (c) Does not seems to be able to assign variables.
1

Please sign in to leave a comment.