Interactive python session while in debug?

Multiple times I found myself wanting to write arbitrary bits of code while stopped on a line within a debug session.  For example, I have instantiated an object in a function and want to call an arbitrary method that's not part of the function on that object.

I can sort of cheat by running the function within the "Watches" pane in the debug session, then going to the console and see its output.  You can test this by simply "watching" for "print 'hello there'" and seeing the output show up in the console.

Ideally the console tab had an interactive prompt and then I wouldn't have to clean up a watch entry or flip back and forth between tabs.

Is this somewhere in the IDE already and I'm just not seeing it?  From what I can tell all the plumbing is already there and it's a matter of finding the UI functionality.

Thanks!

6 comments

Cool, I'm glad to see that it's somewhere, but, why don't I have that button myself?

pycharm_missing_console_button.png



Attachment(s):
pycharm_missing_console_button.png
pycharm_missing_console_button.png
0

Hi Roberto,

what version of PyCharm are you using? Show debug command line button was introduced in PyCharm 1.1.

0

Dimitry, PyCharm 1.1.1 on OS X 10.6.6

-Roberto.

pycharm_version.png



Attachment(s):
pycharm_version.png
0

Random data point: I noticed I had the button to show the interactive prompt while remotely debugging a script running on a Windows machine.  I do not see it in either a nosetest or unittest debug session, though.

0

Hello Roberto,

Indeed, due to a limitation in PyCharm 1.1.1 the debug console is not available

when debugging unit tests. I've filed a feature request for that:

http://youtrack.jetbrains.net/issue/PY-2932

Random data point: I noticed I had the button to show the interactive

prompt while remotely debugging a script running on a Windows machine.

I do not see it in either a nosetest or unittest debug session,

though.

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0

Please sign in to leave a comment.