2

By default, all scripts in PyCharm seem to execute in a separate python interpreter called "Run", which, as far as I can make out, is pretty much independent of the IPython console running alongside. Now, to execute any snippet of the script after the whole thing has been run, I can copy-paste into the Run pane, but this is not ideal as it is not an actual python/ipython console. If I want to execute in the console, I will need to run the whole thing again inside the console (and not just a snippet) because the console doesn't seem to recognize/store any of the variables when it was run, which is tedious.

I've searched for a solution, but the closest I got was to enable "show command line afterwords" in the Run Configurations. This just seems to throw up an error on the lines of "file not found", which makes no sense. I'm running my script through SSH into a remote server, if that helps.

1
  • ipython haa a %run magic that runs the script in the console's namespace, and leaves the results in that space. I don't know what the PyCharm layer does. Commented Jun 30, 2017 at 19:19

2 Answers 2

3
  1. Go to run --> edit configurations...
  2. towards the button you'll see a checkbox that says "run with python console"
  3. make sure its checked
Sign up to request clarification or add additional context in comments.

Comments

0

try to edit the run config, via run -> edit configuration. And check the path of the working directory or the script directory.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.