Home > Backend Development > Python Tutorial > How to run pycharm step by step

How to run pycharm step by step

下次还敢
Release: 2024-04-19 07:57:21
Original
1330 people have browsed it

Methods to step-by-step run the code in PyCharm: 1. Set breakpoints; 2. Start a debugging session; 3. Step through the code; 4. Step out of the code; 5. Run to the cursor; 6. Return to normal implement.

How to run pycharm step by step

Run the code step by step in PyCharm

In PyCharm, you can run the code step by step as follows:

1. Set a breakpoint

  • Place the cursor on the line of code where you want execution to stop.
  • Click on the left edge of the editor, or press F8.

2. Start a debugging session

  • In the Run menu, select "Debug" and then "Start Debugging" (or press Ctrl Alt D).
  • Alternatively, click the "Debug" button (debug icon) in the toolbar.

3. Step through the code

  • #F10 (Windows/Linux) or Fn F10 (Mac): Step through the code, one line at a time.
  • F11 (Windows/Linux) or Fn F11 (Mac): Step into functions.

4. Step out of the code

  • Shift F11 (Windows/Linux) or Fn Shift F11 (Mac): Step out of a function.

5. Run to the cursor

  • Alt F9 (Windows/Linux) or Option F9 (Mac): Run code from the current cursor position until the next breakpoint is encountered.

6. Resume normal execution

  • F5 (Windows/Linux) or Fn F5 (Mac): Resumes normal code execution, skipping all breakpoints.

Tip:

  • You can quickly access these commands using the buttons on the "Debug" toolbar.
  • In a debugging session, you can inspect the value of a variable in the "Variable" window.
  • You can also use the keyboard shortcuts Ctrl Shift F8 to find all breakpoints in your project.

The above is the detailed content of How to run pycharm step by step. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template