天天看点

【Python】【一句话】debug时的选项:Step Over、Step Into、Step Into My Code、Step Out 等的官方说明,最简单最易懂!Show Execution PointStep OverStep IntoStep Into My codeStep OutRun to Curser

文章目录

  • Show Execution Point
  • Step Over
  • Step Into
  • Step Into My code
  • Step Out
  • Run to Curser

本文介绍 Pycharm 中对 .py 文件进行debug时的各种选项的功能。

网上各种文章琳琅满目,但是也让人眼花缭乱。然而,最简单最直白的其实还是官方说明!

Show Execution Point

【Python】【一句话】debug时的选项:Step Over、Step Into、Step Into My Code、Step Out 等的官方说明,最简单最易懂!Show Execution PointStep OverStep IntoStep Into My codeStep OutRun to Curser

Show the current program execution point

显示当前程序执行点

点击后显示代码当前执行的位置。

Step Over

【Python】【一句话】debug时的选项:Step Over、Step Into、Step Into My Code、Step Out 等的官方说明,最简单最易懂!Show Execution PointStep OverStep IntoStep Into My codeStep OutRun to Curser

Step to the next line in this file

转到此文件中的下一行

网上有很多说明,大部分是说:

在函数内遇到子函数时不会进入子函数内单步执行,而是将子函数整个执行完再停止,也就是把子函数整个作为一步。

其实没有那么麻烦,直接看官方说明:转到此文件中的下一行。

也就是说,仅在本文件中一行一行地走。

Step Into

【Python】【一句话】debug时的选项:Step Over、Step Into、Step Into My Code、Step Out 等的官方说明,最简单最易懂!Show Execution PointStep OverStep IntoStep Into My codeStep OutRun to Curser

Step to the next line executed

转到执行的下一行

顾名思义,执行到哪,停到哪!一行都不跳地走。

Step Into My code

【Python】【一句话】debug时的选项:Step Over、Step Into、Step Into My Code、Step Out 等的官方说明,最简单最易懂!Show Execution PointStep OverStep IntoStep Into My codeStep OutRun to Curser

Step to the next line executed ignoring libraries

忽略库转到下一行执行

很简单,My code 就是除了 “库” 以外的文件,也就是我们自己写的代码。所以此选项就是仅在我们自己写的代码中跳转。

Step Out

【Python】【一句话】debug时的选项:Step Over、Step Into、Step Into My Code、Step Out 等的官方说明,最简单最易懂!Show Execution PointStep OverStep IntoStep Into My codeStep OutRun to Curser

Step to the first line executed after returning from this method

从此方法返回后执行第一行

执行到当前方法结束后的第一行。

Run to Curser

【Python】【一句话】debug时的选项:Step Over、Step Into、Step Into My Code、Step Out 等的官方说明,最简单最易懂!Show Execution PointStep OverStep IntoStep Into My codeStep OutRun to Curser

Run to the line where the caret is

执行到插入符号所在的行

光标停在哪,便执行到哪。