PyCharm 2017.2 Help

Python Console

Tools | Python Console

In this section:

Important notes

  • Python console appears as a tool window every time you choose the corresponding command on the Tools menu.
  • An interactive console is divided into two panes: the lower pane serves for user input, the upper pane displays results and messages.
  • Use up and down arrow keys to browse through the history of executed commands, and repeat the desired ones.
  • Python console is available for both local and remote interpreters.
  • Color and font scheme of a console is configurable on the Console Colors and Console Fonts pages of the Color Scheme editor settings.


ItemTooltip and shortcutDescription
rerunConsole Rerun console
Click this button to terminate the current process and launch the new one.
/help/img/idea/2017.2/stop.gif Stop
Click this button to stop the current process.

Clicking the button once invokes soft kill allowing the application to catch the SIGINT event and perform graceful termination (on Windows, the Ctrl+C event is emulated). After the button is clicked once, it is replaced with /help/img/idea/2017.2/icon_run_tool_window_kill.png indicating that subsequent click will lead to force termination of the application, e.g. on Unix SIGKILL is sent.

close.png Close
Click this button to close the selected tab of the Run tool window and terminate the current process.
/help/img/idea/2017.2/run.png Execute Current Statement
Click this button to execute the command at caret, entered in the input pane of the console.
help Help
Use this icon or shortcut to open the corresponding help page.
show-watches Show variablesClick this button to show in a separate pane the variables declared in the console. Right-click on a variable in this pane reveals a context menu.
/help/img/idea/2017.2/consoleHistory.png Browse History
Use this icon or shortcut to open a dialog that shows all the statements that you have run for the corresponding data source.

See also, Executing auto-memorized statements.

/help/img/idea/2017.2/debug.pngAttach DebuggerAttaches the debugger process to the console.
/help/img/idea/2017.2/add.pngNew ConsoleClick this button to start a new console session.

Context menu commands

Compare with ClipboardShow selection in the console and contents of the Clipboard in the Differences viewer.
/help/img/idea/2017.2/gist.pngCreate GistChoose this command to create a Git Gist.
/help/img/idea/2017.2/icon_clear_all.pngClear AllChoose this item on the context menu to delete all messages from the upper part of the console.
PasteCtrl+VInsert the last entry of the Clipboard next to the caret position in the lower part of the console.
Paste from HistoryCtrl+Shift+VInsert selected entry of the Clipboard next to the caret position in the lower part of the console.
Paste SimpleCtrl+Shift+VInsert selected entry of the Clipboard as plain text, next to the caret position in the lower part of the console.

See Also

Last modified: 9 August 2017