Access python console and program variables after program finished running?

I am considering PyCharm as my main Python IDE, but I can't seem to find a way to do what is my favorite feature of Spyder. After running a program everything is just available in the python console. I can type in any variable or object and tweak it or run other code on it. However in PyCharm, it seems like once you get the "Process finished with exit code 0", the console is shutdown with no more access to any of the code run. Is there some way to keep the console alive with all that information? I'm not a fan of needing to create an extra breakpoint at the end of the program and debug every time I want to have access to anything in the code.

Also when going to tools/run python console, this console is disconnected from what is being run. I would really just like a persistent console that whatever program I run runs in. Is there a way to make it when I run the program it shows up in that console instead of making its own separate one?
Comment actions Permalink
Hi, unfortunately there is no way yet to stop after script execution with the access to variables. Please vote for the feature:
As for console during debugging, you can press 'Show command line' button in debugger console output tab:
Comment actions Permalink

I ended up here searching for this feature. It has been implemented and it's under Run > Edit configurations > Run with Python console

Great job devs :)


Please sign in to leave a comment.