How To Run A File In The IPython Console As Default Instead Of Terminal?

In this article we are going to discuss one of the most commonly searched questions by Python enthusiasts, i.e., How To Run A File In The IPython Console As Default Instead Of Terminal?

#Note

source: Wikipedia

Problem Statement

Suppose you have started a new project in PyCharm and you have installed and selected Anaconda python.exe as the project interpreter. The first time you run PyCharm, it uses the IPython console as the “default” console to run your script. However, when you restart your PC, you run into a strange issue because PyCharm now uses the terminal when you run your scripts.

Wait!!!! 😲 This is not what you wanted! Instead, you are comfortable with IPython and you would like to use it. So, how do you use the IPython console by default every time you work with your project?

So let us go ahead and address this issue for you and once for and all resolve our problem.

Solution

To make sure that your script always runs in the IPython console, make sure that you have the following settings properly configured while executing your project.

Step 1: Click on File Click on Settings from the drop down menu

Step 2: The setting dialog box appears. Select Build, Execution, DeploymentConsolePython Console. Make sure that the option Use IPython if available is checked and click on OK to apply the settings.

Step 3: Click on Run  Edit Configurations. The Run/Debug Configurations dialog box appears. Here, check the box Run with Python Console click on OK to apply/save the changes.

After you have configured the above settings, you can run selected parts of your code by using the following keyboard shortcut: ALT+SHIFT+E

Disable IPython Console In Pycharm

If you follow the above steps/procedure then every time you run your code, it will be executed in IPython Console. However, if for some reason you want to disable the IPython console, all you have to do is go ahead and open up The Settings dialog box as mentioned above. (You can also use the Keyboard shortcut CTRL+ALT+S to open the settings dialog box). Once the settings dialog box appears, uncheck the ☐ Use IPython if available check box and click on Ok to apply the changes.

🤷‍♂️ Do You Know The Difference Between Terminal and Console in PyCharm?

✨ The PyCharm Terminal is nothing but a replacement for your command-prompt/power-shell on windows and the terminal app on Mac. It provides you a way to access them without having to leave PyCharm.

✨ The PyCharm Console on the other hand can be considered as an advanced version of the “Python Console” which allows you to run bits of Python. It is also known as REPL or Read Eval Print Loop.

Conclusion

I hope after reading this article you can easily run your scripts in IPython console within PyCharm without any hassle.

The Complete Guide to PyCharm

Do you want to master the most popular Python IDE fast? This PyCharm Masterclass course will take you from beginner to expert in PyCharm in ~90 minutes. For any software developer, it is crucial to master the IDE well, to write, test, and debug high-quality code with little effort. Join the PyCharm Masterclass now, and master PyCharm by tomorrow!

Where to Go From Here?

Enough theory, let’s get some practice!

To become successful in coding, you need to get out there and solve real problems for real people. That’s how you can become a six-figure earner easily. And that’s how you polish the skills you really need in practice. After all, what’s the use of learning theory that nobody ever needs?

Practice projects is how you sharpen your saw in coding!

Do you want to become a code master by focusing on practical code projects that actually earn you money and solve problems for people?

Then become a Python freelance developer! It’s the best way of approaching the task of improving your Python skills—even if you are a complete beginner.

Join my free webinar “How to Build Your High-Income Skill Python” and watch how I grew my coding business online and how you can, too—from the comfort of your own home.

Join the free webinar now!

Where to Go From Here?

Enough theory, let’s get some practice!

To become successful in coding, you need to get out there and solve real problems for real people. That’s how you can become a six-figure earner easily. And that’s how you polish the skills you really need in practice. After all, what’s the use of learning theory that nobody ever needs?

Practice projects is how you sharpen your saw in coding!

Do you want to become a code master by focusing on practical code projects that actually earn you money and solve problems for people?

Then become a Python freelance developer! It’s the best way of approaching the task of improving your Python skills—even if you are a complete beginner.

Join my free webinar “How to Build Your High-Income Skill Python” and watch how I grew my coding business online and how you can, too—from the comfort of your own home.

Join the free webinar now!