PyCharm 2026.1 Help

スクリプトコンソール​

IDE スクリプトコンソールは、PyCharm の機能を自動化したり、さまざまな情報を抽出したりする簡単なスクリプトを書くために使用できます。 IntelliJ プラットフォーム API(英語) にアクセスすれば、IDE の動作を追加または変更するプラグインの代わりとなる軽量なものと考えることができます。

By default, it supports scripts written in Groovy. ただし、Python、Ruby、Clojure など、 JSR 223(英語) に準拠した任意のスクリプト言語を使用できます。

For the full list of available scripting languages and engines, refer to IDE Scripting.md (GitHub Gist).

IDE スクリプティングコンソールを開く

  1. Ctrl+Shift+A を押して、 IDE スクリプトコンソール と入力します。 必要なオプションが見つかったら、それをクリックしてコンソールを実行します。

  2. This opens the IDE Scripting Console tab in the editor, where you can type code and execute it.

    For example, create a Groovy script to run a bulk rename action inside the IDE with the following code: multiple-files-rename-action.groovy (GitHub Gist).

  3. Select it all with the mouse pointer or Ctrl+A and then press Ctrl+Enter to run it.

    You should see the result of executing each line in the 実行 tool window and a popup dialog titled test with the average length of numbered elements in the array. Click OK to close it.

スクリプトは consoles/ide 構成ディレクトリ​ に保存されています。 Scratches and Consoles/IDE Consoles Project ツールウィンドウにも表示されます。 .profile という名前のファイルに続けてこのディレクトリに対応する言語を指定すると( .profile.groovy など)、実行したスクリプトと一緒にそのファイルが実行されます。 プロファイルを使用してスクリプトの機能を定義します。

2026 年 6 月 1 日