Skip to content Skip to sidebar Skip to footer

Pycharm Running Python File Always Opens A New Console

I initially started learning Python in Spyder, but decided to switch to PyCharm recently, hence I'm learning PyCharm with a Spyder-like mentality. I'm interested in running a file

Solution 1:

There is a specific option in PyCharm 2018.2+: Settings | Build, Execution, Deployment | Console | Use existing console for "Run with Python console".

Run with Python console is an option you have enabled in the Run Configuration. Disable it if you don't need a Python console after a script execution:

enter image description here

Solution 2:

Hi: If you are looking for re running the code again in the same python console everytime then you have to check the respective box in the Project settings as shown in image below.

enter image description here

Solution 3:

To allow only one instance to run, go to "Run" in the top bar, then "Edit Configurations...". Finally, check "Single instance only" at the right side. This will run only one instance and restart every time you run.

Solution 4:

One console is one instance of Python being run on your system. If you want to run different variations of code within the same Python kernel, you can highlight the code you want to run and then choose the run option (Alt+Shift+F10 default).

Solution 5:

You have an option to Rerun the program.

Simply open and navigate to currently running app with:

  • Alt+4 (Windows)
  • +4 (Mac)

And then rerun it with:

  • Ctrl+R (Windows)
  • +R (Mac)

Another option:

Show actions popup:

  • Ctrl+Shift+A (Windows)
  • ++A (Mac)

And type Rerun ..., IDE then hint you with desired action, and call it.

Post a Comment for "Pycharm Running Python File Always Opens A New Console"