当我在pdb中时,我有一个大字符串,有时候我想用新行打印出来作为实际换行符,而不是在终端中将它们视为\ n 。在python 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
"
任何提示吗?
(当你在打印pdb的东西的时候,你也应该检查一下'pp',它的确很漂亮打印,这是非常方便的列表和字典) – spectras