PyCharm 2023.1 Help

Run and rerun applications

With PyCharm, you can run entire applications as well as particular scripts.

PyCharm uses settings that are defined in a Run/debug configurations. All the run configurations that currently exist in a project, are available in the Select Run/Debug Configuration list.

Select Run/Debug Configuration

If you want to see the list of all currently running applications, select Run | Show Running List from the main menu. Refer to the View running processes section for details.

After you've started a run session, the App actions execute icon in the Run tool window and in the Run/Debug Configuration Selector toggles to App actions restart to indicate that the run process is active and can be restarted.

Running a script

  • Choose Run | Run from the main menu or press Alt+Shift+F10, and then select the desired run/debug configuration.

    This way, you can run any available run/debug configuration. Choose the desired run/debug configuration from the popup menu that shows all the run/debug configurations existing in the project.

    Run from the main menu
    Run popup

    See Using the Run popup menu for details.

  • For the main clause: In the gutter, click Run icon, and choose the desired command.

    Run from the left gutter
  • Choose Run <name> from the context menu:

    Run context menu
  • Select the desired module in the Project tool window and choose Run <name > from the context menu of the selection.

    Run script from the project tool window
  • In the Select Run/Debug Configuration list, select Current File, and click App actions execute in the toolbar.

    This option lets you run the currently opened file instantly without creating a run/debug configuration.

    Run current file

    You can access other runners from the submenu as well: expand the list and click the right arrow next to Current File. From the menu that opens, you can debug the code, run it with coverage, profile it, or open the run configuration to specify more options.

    More options for running current file

You can review any output from your running applications in the Run window console. The output from each application is displayed in its own tab of the Run tool window, named after the corresponding run/debug configuration.

If you re-run an application, the new output overwrites the contents of the tab. To preserve the output of an application, even if you re-run it, pin the output tab: right-click the tab and select Pin Tab.

Invoke the Run popup menu either by choosing the Run | Run command from the main menu, or by pressing Alt+Shift+F10.

Run popup

From this popup menu you can:

  • Invoke the Edit Configuration dialog.

  • Edit the selected configuration before launch F4.

  • Instantly delete a configuration Delete.

  • Switch from run to debug and vice versa (hold Shift).

  • Access a previously selected configuration 1.

This popup menu can also be quickly accessed by pressing F9, when you're not running any debug session.

Rerunning applications

  1. In the Run window, select the tab where the desired application is opened.

  2. In the toolbar of the Run window, click the Rerun button App actions restart, or press Control+F5.

Last modified: 25 April 2023