How to run a file in IPython console as default instead of terminal?
Short answer:
- Go to
File > Default settings > Build, Execution, Deployment > Console
and selectUse Ipython if available
- Go to
Run > Edit Configurations
and selectShow command line afterwards
Tip: Run selected parts of your code with ALT + SHIFT + E
The details:
If you've selected Anaconda
as the project interpreter, IPython will most likely be the selected console even though it neither looks nor behaves like the IPython console you are used to in Spyder
:
Unlike Spyder, PyCharm has no graphical indicator
showing that this is an IPython console.
To make sure it's an IPython console and make it behave more or less like the IPython console you are used to from Spyder, you should follow these two steps:
Go to
File > Default Settings > Build, Execution, Deployment > Console
and make sure to selectUse IPython if available
.Go to
Run > Edit Configurations
and selectShow command line afterwards
Now you can run selected parts of your code with ALT+SHIFT+E
more or less exactly like in Spyder.
If this doesn't do the trick, you should check out these other posts on SO:
Interacting with program after execution
Disable ipython console in pycharm
In the new version of Pycharm, you have a different option in Edit Configuration.
Go to Run > Edit Configurations
and select Run with Python console