PyCharm 2016.2 Help

Attaching to Local Process

On this page:

Introduction

PyCharm makes it possible to attach to a Python process, while running a Python script launched either outside of PyCharm, or inside PyCharm, but NOT in the debug mode.

Attaching to local process

To attach to a local process, follow these general steps:

  1. Make sure that the desired script is running.
  2. On the main menu, choose Tools | Attach to Process. PyCharm shows the list of running Python processes on a system.
  3. From the list of Python processes, select the one to connect to, and click OK.

    PyCharm starts the debugger session in the Debug tool window.

  4. Proceed with debugging in the same way as you usually do it in PyCharm (set breakpoints, step through the script, pause and resume the process, evaluate expressions etc.)
  5. When finished, detach the process: select the Run | Stop menu option or click the Stop the process button of the Debug Tool Window.

See Also

Last modified: 23 November 2016