PyCharm 2024.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. For more information, refer to View running processes.

After you've started a run session, the Run icon in the Run widget and in the Run/Debug Configuration Selector toggles to 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 popup

    For more information, refer to Using the Run popup menu.

  • Right-click an open file in the editor and choose Run <filename> from the context menu.

    Run context menu
  • Click Run Run in the gutter and choose Run <script name>.

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

  • In the Run widget, select Current File and click Run Run.

    Run current file

    You can click Debug Debug to start the debugger or click More Actions More Actions to select other running modes:

    More options for running current file

You can review the output from your running applications in the Run tool window. The output from each application is displayed in its own tab, 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 Run widget, click Rerun Rerun, or press Ctrl+F5.

Last modified: 26 May 2024