新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)Python教程:python中pdb有哪些調(diào)試命令
1、next執(zhí)行下一條語句,如果本句是函數(shù)調(diào)用,則執(zhí)行函數(shù),接著執(zhí)行當前執(zhí)行語句的下一條。

成都創(chuàng)新互聯(lián)10多年成都定制網(wǎng)頁設(shè)計服務(wù);為您提供網(wǎng)站建設(shè),網(wǎng)站制作,網(wǎng)頁設(shè)計及高端網(wǎng)站定制服務(wù),成都定制網(wǎng)頁設(shè)計及推廣,對成都自上料攪拌車等多個方面擁有多年的網(wǎng)站設(shè)計經(jīng)驗的網(wǎng)站建設(shè)公司。
def stop_here(self, frame): ... # 如果frame還沒跳出stopframe,永遠返回true if frame is self.stopframe: if self.stoplineno == -1: return False return frame.f_lineno >= self.stoplineno # 如果frame跳出了stopframe,進入下一個frame,則執(zhí)行不會中斷,一直到跳出到stopframe # 還有一種情況,如果在return事件中斷執(zhí)行了next,下一次跟蹤在上一級frame中,此時上一級frame能跟蹤到botframe,中斷 while frame is not None and frame is not self.stopframe: if frame is self.botframe: return True frame = frame.f_back return False
2、step執(zhí)行下一條命令,如果本句是函數(shù)調(diào)用,則s會執(zhí)行到函數(shù)的第一句。
def stop_here(self, frame): ... # stopframe為None if frame is self.stopframe: ... # 當前frame一定會追溯到botframe,返回true while frame is not None and frame is not self.stopframe: if frame is self.botframe: return True frame = frame.f_back return False
3、return執(zhí)行當前運行函數(shù)到結(jié)束。
def stop_here(self, frame): ... # 如果當前幀代碼順序執(zhí)行,下一個frame的lineno==stoplineno # 如果執(zhí)行到for循環(huán)的最后一行,下一個frame(for循環(huán)第一行)的lineno= self.stoplineno # 如果在非botframe中,會先追溯到stopframe,返回false,同next while frame is not None and frame is not self.stopframe: if frame is self.botframe: return True frame = frame.f_back return False
以上就是python中pdb調(diào)試命令的介紹,希望對大家有所幫助。更多Python學(xué)習(xí)指路:創(chuàng)新互聯(lián)python教程
本文教程操作環(huán)境:windows7系統(tǒng)、Python 3.9.1,DELL G3電腦。
分享題目:創(chuàng)新互聯(lián)Python教程:python中pdb有哪些調(diào)試命令
當前網(wǎng)址:http://m.fisionsoft.com.cn/article/djihhcc.html


咨詢
建站咨詢
