id: 414b23deb67d4e46a40689deba2386ac
parent_id: 
item_type: 1
item_id: 0ff162922b0442e3848e4fdf01d343a9
item_updated_time: 1764345475669
title_diff: "[{\"diffs\":[[1,\"10分钟教程掌握Python调试器pdb\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":20}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>10分钟教程掌握Python调试器pdb</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"7432\\\"></a>\\\r\\\n<h1>10分钟教程掌握Python调试器pdb</h1>\\\r\\\n\\\r\\\n<div><span>\\\n  <div>\\\n<div><br/></div><div style=\\\"font-size: 16px; display:block; min-width: 100%; position: relative;\\\"> <div><div style=\\\"font-family:-apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Source Han Sans SC&quot;, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif;color:rgb(26, 26, 26);-webkit-tap-highlight-color:rgba(26, 26, 26, 0);background:rgb(255, 255, 255);\\\"><div><div><span><div style=\\\"background:rgb(255, 255, 255);min-width:1000px;overflow:hidden;\\\"><div style=\\\"box-sizing:border-box;overflow:hidden;\\\"><div style=\\\"overflow:hidden;width:690px;margin:0px auto;\\\"><h1 style=\\\"font:inherit;font-weight:600;font-size:24px;line-height:1.22;overflow-wrap:break-word;margin:24px 0px;\\\">10分钟教程掌握Python调试器pdb</h1><div style=\\\"display:flex;-webkit-box-align:center;align-items:center;\\\"><div style=\\\"display:flex;-webkit-box-align:center;align-items:center;-webkit-box-flex:1;flex:1 1 0%;white-space:nowrap;overflow:hidden;\\\"><span><div style=\\\"position:relative;display:inline-block;\\\"><div><a href=\\\"https://www.zhihu.com/people/splinzer\\\" style=\\\"color:inherit;text-decoration:none;\\\" target=\\\"_blank\\\"><img src=\\\":/2b5c44239eca4671a1e411dea88103db\\\" type=\\\"image/jpeg\\\" data-filename=\\\"v2-bcd61ee944605999dc2a130446396696_l.jpg\\\" height=\\\"38\\\" style=\\\"background:rgb(255, 255, 255);vertical-align:top;border-radius:50%;\\\" width=\\\"38\\\"/></a></div></div></span><div style=\\\"-webkit-box-flex:1;flex:1 1 0%;margin-left:14px;overflow:hidden;\\\"><div style=\\\"display:flex;-webkit-box-align:center;align-items:center;font-size:15px;line-height:1.1;flex-shrink:0;\\\"><span style=\\\"font-weight:600;color:rgb(68, 68, 68);\\\"><div style=\\\"position:relative;display:inline-block;\\\"><div><a href=\\\"https://www.zhihu.com/people/splinzer\\\" style=\\\"color:inherit;text-decoration:none;\\\" target=\\\"_blank\\\">splinzer</a></div></div></span></div><div style=\\\"overflow:hidden;color:rgb(100, 100, 100);\\\"><div style=\\\"display:flex;-webkit-box-align:center;align-items:center;margin-top:2px;font-size:14px;\\\"><div style=\\\"word-break:break-word;line-height:1.6;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:rgb(100, 100, 100);\\\">寻找宇宙的Bug</div></div></div></div></div></div><div><span style=\\\"display:block;margin-top:14px;font-size:14px;color:rgb(133, 144, 166);\\\"></span></div></div><div style=\\\"width:690px;margin:0px auto;overflow:visible;\\\"><div style=\\\"word-break:break-word;line-height:1.6;margin-top:20px;\\\"><p style=\\\"margin:1.4em 0px;margin-top:0px;\\\">如果你还主要靠print来调试代码，那值得花10分钟试试pdb这个Python自带的Debug工具。</p><p style=\\\"margin:1.4em 0px;\\\">pdb有2种用法：</p><ul style=\\\"display:table;padding:0px;margin:1.4em 0px;\\\"><li style=\\\"list-style-type:none;display:table-row;list-style:none;\\\"><span style=\\\"list-style-type:none;list-style:none;display:table-cell;white-space:pre;\\\">•  </span><b style=\\\"font-weight:600;\\\">非侵入式方法</b>（不用额外修改源代码，在命令行下直接运行就能调试）</li></ul><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">python3 -m pdb filename.py</code></pre></div><ul style=\\\"display:table;padding:0px;margin:1.4em 0px;\\\"><li style=\\\"list-style-type:none;display:table-row;list-style:none;\\\"><span style=\\\"list-style-type:none;list-style:none;display:table-cell;white-space:pre;\\\">•  </span><b style=\\\"font-weight:600;\\\">侵入式方法</b>（需要在被调试的代码中添加一行代码然后再正常运行代码）</li></ul><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\"><span style=\\\"font-weight:600;\\\">import</span> <span style=\\\"color:rgb(100, 100, 100);\\\">pdb</span><span>;</span><span>pdb</span><span style=\\\"font-weight:600;\\\">.</span><span>set_trace</span><span>()</span></code></pre></div><p style=\\\"margin:1.4em 0px;\\\">当你在命令行看到下面这个提示符时，说明已经正确打开了pdb</p><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">(Pdb) </code></pre></div><p style=\\\"margin:1.4em 0px;\\\">然后就可以开始输入pdb命令了，下面是pdb的常用命令</p><h2 style=\\\"margin:0px;font:inherit;clear:left;margin-top:2.33333em;margin-bottom:1.16667em;font-size:1.2em;line-height:1.5;font-weight:600;\\\">1、查看源代码</h2><p style=\\\"margin:1.4em 0px;\\\">命令：</p><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">l</code></pre></div><p style=\\\"margin:1.4em 0px;\\\">说明：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">查看当前位置前后11行源代码（多次会翻页）<br/>当前位置在代码中会用--&gt;这个符号标出来</blockquote><p style=\\\"margin:-0.8em 0px;\\\"><br/></p><p style=\\\"margin:1.4em 0px;\\\">命令：</p><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">ll</code></pre></div><p style=\\\"margin:1.4em 0px;\\\">说明：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">查看当前函数或框架的所有源代码</blockquote><h2 style=\\\"margin:0px;font:inherit;clear:left;margin-top:2.33333em;margin-bottom:1.16667em;font-size:1.2em;line-height:1.5;font-weight:600;\\\">2、添加断点</h2><p style=\\\"margin:1.4em 0px;\\\">命令：</p><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">b\\\nb lineno\\\nb filename:lineno \\\nb functionname</code></pre></div><p style=\\\"margin:1.4em 0px;\\\">参数：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">filename文件名，断点添加到哪个文件，<a href=\\\"https://link.zhihu.com/?target=http%3A//xn--test-f96g.py/\\\" rel=\\\"nofollow noreferrer\\\" style=\\\"color:inherit;cursor:pointer;border-bottom:1px solid grey;text-decoration:none;\\\" target=\\\"_blank\\\">如test.py</a><br/>lineno断点添加到哪一行<br/>function：函数名，在该函数执行的第一行设置断点</blockquote><p style=\\\"margin:1.4em 0px;\\\">说明：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">1.不带参数表示查看断点设置<br/>2.带参则在指定位置设置一个断点</blockquote><h2 style=\\\"margin:0px;font:inherit;clear:left;margin-top:2.33333em;margin-bottom:1.16667em;font-size:1.2em;line-height:1.5;font-weight:600;\\\">3、添加临时断点</h2><p style=\\\"margin:1.4em 0px;\\\">命令：</p><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">tbreak\\\ntbreak lineno\\\ntbreak filename:lineno\\\ntbreak functionname</code></pre></div><p style=\\\"margin:1.4em 0px;\\\">参数：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">同b</blockquote><p style=\\\"margin:1.4em 0px;\\\">说明：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">执行一次后时自动删除（这就是它被称为临时断点的原因）</blockquote><h2 style=\\\"margin:0px;font:inherit;clear:left;margin-top:2.33333em;margin-bottom:1.16667em;font-size:1.2em;line-height:1.5;font-weight:600;\\\">4、清除断点</h2><p style=\\\"margin:1.4em 0px;\\\">命令：</p><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">cl\\\ncl filename:lineno\\\ncl bpnumber [bpnumber ...]</code></pre></div><p style=\\\"margin:1.4em 0px;\\\">参数：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">bpnumber 断点序号（多个以空格分隔）</blockquote><p style=\\\"margin:1.4em 0px;\\\">说明：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">1.不带参数用于清除所有断点，会提示确认（包括临时断点）<br/>2.带参数则清除指定文件行或当前文件指定序号的断点</blockquote><h2 style=\\\"margin:0px;font:inherit;clear:left;margin-top:2.33333em;margin-bottom:1.16667em;font-size:1.2em;line-height:1.5;font-weight:600;\\\">5、打印变量值</h2><p style=\\\"margin:1.4em 0px;\\\">命令：</p><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">p expression</code></pre></div><p style=\\\"margin:1.4em 0px;\\\">参数：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">expression Python表达式</blockquote><h2 style=\\\"margin:0px;font:inherit;clear:left;margin-top:2.33333em;margin-bottom:1.16667em;font-size:1.2em;line-height:1.5;font-weight:600;\\\">6、逐行调试命令</h2><p style=\\\"margin:1.4em 0px;\\\">包括 s ，n ， r 这3个相似的命令，区别在如何对待函数上</p><p style=\\\"margin:1.4em 0px;\\\">命令1：</p><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">s</code></pre></div><p style=\\\"margin:1.4em 0px;\\\">说明：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">执行下一行（能够进入函数体）</blockquote><p style=\\\"margin:-0.8em 0px;\\\"><br/></p><p style=\\\"margin:1.4em 0px;\\\">命令2：</p><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">n </code></pre></div><p style=\\\"margin:1.4em 0px;\\\">说明：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">执行下一行（不会进入函数体）</blockquote><p style=\\\"margin:-0.8em 0px;\\\"><br/></p><p style=\\\"margin:1.4em 0px;\\\">命令3：</p><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">r </code></pre></div><p style=\\\"margin:1.4em 0px;\\\">说明：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">执行下一行（在函数中时会直接执行到函数返回处）</blockquote><h2 style=\\\"margin:0px;font:inherit;clear:left;margin-top:2.33333em;margin-bottom:1.16667em;font-size:1.2em;line-height:1.5;font-weight:600;\\\">7、非逐行调试命令</h2><p style=\\\"margin:1.4em 0px;\\\">命令1：</p><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">c </code></pre></div><p style=\\\"margin:1.4em 0px;\\\">说明：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">持续执行下去，直到遇到一个断点</blockquote><p style=\\\"margin:-0.8em 0px;\\\"><br/></p><p style=\\\"margin:1.4em 0px;\\\">命令2</p><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">unt lineno</code></pre></div><p style=\\\"margin:1.4em 0px;\\\">说明：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">持续执行直到运行到指定行（或遇到断点）</blockquote><p style=\\\"margin:-0.8em 0px;\\\"><br/></p><p style=\\\"margin:1.4em 0px;\\\">命令3</p><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">j lineno</code></pre></div><p style=\\\"margin:1.4em 0px;\\\">说明：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">直接跳转到指定行（注意，被跳过的代码不执行）</blockquote><h2 style=\\\"margin:0px;font:inherit;clear:left;margin-top:2.33333em;margin-bottom:1.16667em;font-size:1.2em;line-height:1.5;font-weight:600;\\\">8、查看函数参数</h2><p style=\\\"margin:1.4em 0px;\\\">命令：</p><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">a</code></pre></div><p style=\\\"margin:1.4em 0px;\\\">说明：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">在函数中时打印函数的参数和参数的值</blockquote><p style=\\\"margin:-0.8em 0px;\\\"><br/></p><h2 style=\\\"margin:0px;font:inherit;clear:left;margin-top:2.33333em;margin-bottom:1.16667em;font-size:1.2em;line-height:1.5;font-weight:600;\\\">9、打印变量类型</h2><p style=\\\"margin:1.4em 0px;\\\">命令：</p><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">whatis expression</code></pre></div><p style=\\\"margin:1.4em 0px;\\\">说明：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">打印表达式的类型，常用来打印变量值</blockquote><h2 style=\\\"margin:0px;font:inherit;clear:left;margin-top:2.33333em;margin-bottom:1.16667em;font-size:1.2em;line-height:1.5;font-weight:600;\\\">10、启动交互式解释器</h2><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">interact</code></pre></div><p style=\\\"margin:1.4em 0px;\\\">说明：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">启动一个python的交互式解释器，使用当前代码的全局命名空间（使用ctrl+d返回pdb）</blockquote><h2 style=\\\"margin:0px;font:inherit;clear:left;margin-top:2.33333em;margin-bottom:1.16667em;font-size:1.2em;line-height:1.5;font-weight:600;\\\">11、打印堆栈信息</h2><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">w</code></pre></div><p style=\\\"margin:1.4em 0px;\\\">说明：</p><blockquote style=\\\"margin:1.4em 0px;padding-left:1em;color:rgb(100, 100, 100);border-left:3px solid rgb(211, 211, 211);\\\">打印堆栈信息，最新的帧在最底部。箭头表示当前帧。</blockquote><h2 style=\\\"margin:0px;font:inherit;clear:left;margin-top:2.33333em;margin-bottom:1.16667em;font-size:1.2em;line-height:1.5;font-weight:600;\\\">12、退出pdb</h2><div style=\\\"margin:1em 0px;\\\"><pre style=\\\"padding:0.88889em;font-size:0.9em;word-break:normal;overflow-wrap:normal;white-space:pre;overflow:auto;background:rgb(246, 246, 246);border-radius:4px;margin:1.4em 0px;\\\"><code style=\\\"font-family:Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace;margin:0px;padding:0px;border-radius:0px;font-size:inherit;background-color:inherit;\\\">q</code></pre></div><p style=\\\"margin:-0.8em 0px;\\\"><br/></p><p style=\\\"margin:1.4em 0px;\\\">完成了。好吧，可能超过了10分钟，我承认这是一个善意的谎言，不过至此你已经掌握了，击个掌吧。</p><p style=\\\"margin:1.4em 0px;\\\"></p><p style=\\\"margin:1.4em 0px;\\\"></p><p style=\\\"margin:1.4em 0px;\\\"></p><p style=\\\"margin:1.4em 0px;margin-bottom:0px;\\\"></p></div></div><div style=\\\"font-size:14px;color:rgb(133, 144, 166);padding:16px 0px;overflow:hidden;width:690px;margin:0px auto;\\\">编辑于 2018-05-25</div><div style=\\\"overflow:hidden;width:690px;margin:0px auto;display:flex;\\\"><div style=\\\"display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-flow:row wrap;-webkit-box-align:center;align-items:center;margin-bottom:-10px;padding:16px 0px;\\\"><div style=\\\"position:relative;display:inline-block;padding:0px 12px;color:rgb(0, 132, 255);vertical-align:top;border-radius:100px;background:rgba(0, 132, 255, 0.1);overflow:hidden;margin-bottom:10px;height:33px;font-size:13px;line-height:33px;margin-right:5px;\\\"><span><a href=\\\"https://www.zhihu.com/topic/19552832\\\" style=\\\"color:inherit;text-decoration:none;\\\" target=\\\"_blank\\\"><div style=\\\"position:relative;display:inline-block;\\\"><div>Python</div></div></a></span></div><div style=\\\"position:relative;display:inline-block;padding:0px 12px;color:rgb(0, 132, 255);border-radius:100px;background:rgba(0, 132, 255, 0.1);overflow:hidden;margin-bottom:10px;height:33px;font-size:13px;line-height:33px;vertical-align:middle;margin-right:5px;\\\"><span><a href=\\\"https://www.zhihu.com/topic/19552826\\\" style=\\\"color:inherit;text-decoration:none;\\\" target=\\\"_blank\\\"><div style=\\\"position:relative;display:inline-block;\\\"><div>编程语言</div></div></a></span></div><div style=\\\"position:relative;display:inline-block;padding:0px 12px;color:rgb(0, 132, 255);border-radius:100px;background:rgba(0, 132, 255, 0.1);overflow:hidden;margin-bottom:10px;height:33px;font-size:13px;line-height:33px;vertical-align:middle;\\\"><span><a href=\\\"https://www.zhihu.com/topic/19660363\\\" style=\\\"color:inherit;text-decoration:none;\\\" target=\\\"_blank\\\"><div style=\\\"position:relative;display:inline-block;\\\"><div>软件调试</div></div></a></span></div></div></div><div style=\\\"overflow:hidden;width:690px;margin:0px auto;\\\"><div style=\\\"background:rgb(255, 255, 255);width:100vw;bottom:0px;left:0px;margin-bottom:10px;\\\"><div style=\\\"display:flex;-webkit-box-align:center;align-items:center;padding:10px 20px;margin:0px -20px -10px;color:rgb(100, 100, 100);background:rgb(255, 255, 255);clear:both;position:relative;\\\"><span style=\\\"flex-shrink:0;\\\"></span><div style=\\\"position:relative;display:inline-block;flex-shrink:0;\\\"><div></div></div><div style=\\\"flex-shrink:0;margin-left:24px;\\\"><div style=\\\"position:relative;display:inline-block;\\\"><div></div></div></div></div></div></div></div></div></span></div></div></div></div></div>\\\n</div>\\\n</span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":22658}]"
metadata_diff: {"new":{"id":"0ff162922b0442e3848e4fdf01d343a9","parent_id":"061de1401cfc4cfaadf6e74e015970e9","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764345714129,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T16:12:21.718Z
created_time: 2025-11-28T16:12:21.718Z
type_: 13