user1941407 user1941407 - 4 years ago 571
Python Question

interactive shell debugging with pycharm

I am new in pycharm. I have been using IDLE for a long time.

It is very convenient to use python objects after script execution in IDLE. Is there any way to use script objects after its execution with interactive python shell using pycharm?

For example, we have got a 'test' project with one file '':

a = '123'
print a

after execution we can get result:

Process finished with exit code 0

How i can use string 'a' with interactive shell?

Answer Source

It is all already there. Just not very obvious how to enable it.

  1. Set a breakpoint in your code and launch debug.
  2. When the breakpoint is reached, click the Console tab, and then click the Show command line icon (see screenshot).

This will enable the ipython interpreter (notice the green >>> on the screenshot) where you can access all the variables in the current scope, and do everything you usually do in the Python shell.

Enabling Python shell for the debugged app

In the latest pycharm version you get full ipython interpreter instead of the plain python shell.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download