<p>当我在pdb中并且有一个大字符串时,有时我希望用换行符作为实际换行符打印出来,而不是在终端中看到它们。在</p>
<pre><code>(Pdb) p large_string
"very large string with newline\nanother line in the large string\n\netc\n"
</code></pre>
<p>我宁愿看看</p>
^{pr2}$
<p>有什么提示吗?在</p>
<p>如果使用Python 2.x,则可以导入print函数:</p>
<pre><code>from __future__ import print_function
(Pdb) print(large_string)
very large string with newline
another line in the large string
</code></pre>