Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如,在 R 中,您可以设置选项(错误 = 恢复),并且每当发生错误时,它会让您检查当时处于活动状态的所有函数以及它们范围内的所有变量。这基本上就像在发生错误的地方追溯插入断点一样。
pdb 或 Python 有这样的工具吗?
如果你使用 VS Code 作为你的编辑器,你应该能够做到这一点。
只需单击 Run > Start Debugging,然后选择调试配置
我使用不存在的变量的屏幕截图: