草庐IT

historyPath

全部标签

python - 在 pdb 中保存命令历史记录

有没有办法跨session保存pdb(python调试器)命令历史记录?另外,我可以指定历史长度吗?这类似于问题HowcanImakegdbsavethecommandhistory?,但是对于pdb而不是gdb。-非常感谢 最佳答案 参见this邮政。可以在pdb中保存历史记录。默认情况下,pdb不会读取多行。所以所有的功能都需要在一行上。在~/.pdbrc中:importatexitimportosimportreadlinehistoryPath=os.path.expanduser("~/.pyhistory")defsav