当我在pdb中并且有一个很长的字符串时,有时我想将它打印出来并显示为实际的换行符,而不是在终端中看到它们被表示为\n。
(Pdb) p large_string
"very large string with newline\nanother line in the large string\n\netc\n"
我更愿意看到
(Pdb) printwithnewline large_string
"very large string with newline
another line in the large string
etc
"
有什么建议吗?
pp
,它可以进行漂亮的打印,对于列表和字典非常方便) - spectras