Home  >  Article  >  Backend Development  >  How to operate pycharm breakpoint debugging

How to operate pycharm breakpoint debugging

下次还敢
下次还敢Original
2024-04-17 19:43:021285browse

PyCharm breakpoint debugging operation method: set breakpoints (click in the blank space next to the code line number or press F9); run debugging (click the "Run" button or press Alt Shift F10); execute step by step (press F10 Go to the next line, F11 to enter the function); check the variables (in the "Variables" section in the "Debug" window); modify the variables (right-click the variable in the "Variables" section and select "Set Value"); continue execution (press F8 from Continue at the current breakpoint); disable/delete breakpoints (click the blue dot to disable, right-click the breakpoint to delete).

How to operate pycharm breakpoint debugging

PyCharm breakpoint debugging operation method

1. Set breakpoint

  • Click on the blank area next to the code line number, and a blue dot will appear, which is the breakpoint.
  • Shortcut keys: press F9 on Windows/Linux, Fn F9 on macOS.

2. Run debugging

  • Click the "Run" button on the toolbar or press Alt Shift F10.
  • PyCharm will execute the code and stop at the first breakpoint.

3. Step by step execution

  • Press F10 to enter the next line of code.
  • Press F11 to enter the function.
  • Press Shift F11 to exit the function.

4. Check the variables

  • In the "Debug" tool window, expand the "Variables" section.
  • All variables in the current execution scope are displayed here.

5. Modify variables

  • #If the value of a variable is not the expected value, you can modify it in the "Variables" section.
  • Right-click the variable and select "Set Value".

6. Continue execution

  • Press F8 to continue executing the code.
  • PyCharm will continue execution from the current breakpoint until the next breakpoint is encountered or the program ends.

7. Disable/delete breakpoints

  • #Click the blue dot at the breakpoint to disable the breakpoint, click again to reset Enable.
  • Right-click the breakpoint and select "Remove Breakpoint" to delete the breakpoint.

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

Statement:
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