PyCharm provides a temporary editor. You can create a text or a piece of code for search or exploration purposes.

In this section:

Creating scratches

To create a scratch file
  1. Do one of the following:
    • On the main menu, choose Tools | New Scratch File
    • Press Ctrl+Shift+Alt+Insert
  2. Select the language of the future scratch from the list that PyCharm suggests. PyCharm creates a temporary editor tab.
  3. Type the desired code.

Important notes about scratches

Note the following:

  • The scratch code in scripting languages is executable: you can run and debug it.
  • Local history for scratch files is supported.
  • It is possible to perform clipboard operations with scratch files.
  • The scratch files are stored under PyCharm home, in the directory config/scratches 
  • To observe the available scratch files, do one of the following:

Closing scratches

To close a scratch file, just click close1 on the editor tab. Refer to the section Closing Files in the Editor for details.

Deleting scratches

To delete a scratch file, follow these steps:

  1. Switch to the Scratches view of the project tool window.
  2. Under the Scratches pseudo-folder, right-click the scratch file to be deleted, and choose Delete on the context menu.
  3. Confirm deletion.

See Also

Procedures:

Web Resources: