# Python Console

> **TL;DR**
> `File | Settings | Build, Execution, Deployment | Console | Python Console` for Windows and Linux
>
>
>
> `CLion | Settings | Build, Execution, Deployment | Console | Python Console` for macOS
>
>
>
> `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) ![the Settings icon](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.settings.svg)

Use this page to define the Python interpreter, its options, starting script and so on for the Python console.

The console appears as a tool window every time you choose the corresponding command on the `Tools` menu. You can assign a shortcut to open Python console: press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)), navigate to Keymap, specify a shortcut for `Main menu | Tools | Python or Debug Console`.

| Item | Description |
| --- | --- |
| Environment variables |    This field shows the list of environment variables. If the list contains several variables, they are delimited with semicolons.       To fill in the list, click the browse button, or press `Shift+Enter` (Windows), `⇧ ⏎` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⇧ ⏎` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Ctrl+Enter` (Sublime Text), `⌘ ⏎` (Sublime Text (macOS)), `⇧ ⏎` (Xcode), `Shift+Enter` (Visual Studio), `⇧ ⏎` (Visual Studio (macOS)), `Shift+Enter` (ReSharper), `⇧ ⏎` (ReSharper (macOS)), `Shift+Enter` (QtCreator), `⌘ ⏎` (QtCreator (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Eclipse), `⇧ ⏎` (Eclipse (macOS)) and specify the desired set of environment variables in the Environment Variables dialog.       To create a new variable, click ![the Add button](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.add.svg), and type the desired name and value.     You might want to populate the list with the variables stored as a series of records in a text file, for example:    ```PLAINTEXT Variable1 = Value1 Variable2 = Value2 ```   Just copy the list of variables from the text file and click Paste (![Paste](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.paste.svg)) in the Environmental Variables  dialog. The variables will be added to the table. Click Ok to complete the task. At any time, you can select all variables in the Environment Variables dialog, click Copy ![Copy](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.copy.svg), and paste them into a text file.   |
| Python Interpreter | Select one of the pre-configured  [Python interpreters](configuring-available-python-interpreters.html) from the list.  |
| Interpreter options | In this field, specify the string to be passed to the interpreter. If necessary, click Enter, and type the string in the editor. |
| Working directory | Specify a directory to be used by the running console. When this field is left blank, the project directory will be used. |
| Add content roots to PYTHONPATH | Select this checkbox to have the  content roots added to the PYTHONPATH. |
| Add source roots to PYTHONPATH | Select this checkbox to have the  source roots added to the PYTHONPATH. |
| Starting script |                         In this editor area, type the script to be executed in the console after its start-up and initialization.      > **Note:** > Syntax highlighting, code completion, import assistance, documentation, inspections and quick fixes are available in this editor.     By default, this area contains the following script, which causes printing out a header information and extending the system paths:    	   ```PYTHON import sys; print('Python %s on %s' % (sys.version, sys.platform)) sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS]) ```     The `WORKING_DIR_AND_PYTHON_PATHS` variable is hardcoded in CLion. It displays two paths: the project root and the working directory. The project root is the top-level directory of your project. The working directory may coincidence with the project root if not explicitly defined in the Working directory field.     If you want to omit such a printout, delete this script.    |

