How to reinitialize a Python console in PyCharm?

I saw that other IDEs have the ability to right-click and reinitialize the environment. Does anyone know if this is possible in PyCharm, and if so, how is this done?

+21
source share
4 answers

For me there is a small reset button (a small square with a curved green arrow) in the upper left corner of the console, which says: "Rerun" as a tool tip; it looks like a reset console.

+32
source

Look for this button in the console to restart Kernel

Look for this button in the console to restart the kernel

+9
source

Another answer is correct, I am adding a new answer on how to create a shortcut for restarting the console. By default, it does not have a shortcut, but you can add it by matching it in the Keymap.

  1. Open "Preferences" (Mac: Cmd+, ) and search for "rerun"

  2. .Add a keyboard shortcut for Rerun by double-clicking the "Rerun" line. As you can see from the image below, I assign Cmd+Shift+O . preferences screenshot

Now you can restart the console using the shortcut and no longer use the mouse. enter image description here

+3
source

Please note that this button does not reset all variables. But then you can enter on the command line: reset.

0
source

Source: https://habr.com/ru/post/1260061/


All Articles