在 VSCode Python 调试器中强制使用“交互模式”

sub*_*ean 9 python visual-studio-code

如果我在 VSCode 中的调试器下运行 Python 程序,并且该程序具有行import matplotlib.pyplot as plt,我会在 Python 调试控制台(在选项TERMINAL卡下)中看到以下消息:

Backend TkAgg is interactive backend. Turning interactive mode on.
Run Code Online (Sandbox Code Playgroud)

这是所希望的,因为现在当我在选项卡下的 REPL 中探索数据时, 我不必plt.show()每次都 键入。plt.plot()DEBUG CONSOLE

问题是,并非每个程序都有该import行,因此我被迫在调试 REPL 中手动执行此操作,并在每个程序后面plt.plot() 加上plt.show().

我的问题:有没有办法强制这种“交互模式”,也许通过launch.json文件?我查看了文档launch.json ,但没有看到任何适用的内容。

我在 Windows 10 版本 20H2 上使用 VSCode 1.63.2。