【发布时间】:2020-07-15 14:09:49
【问题描述】:
当使用 ctrl+alt+m 停止脚本时,python 不会将其视为中断。我想在退出前执行一个清理脚本。
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("keyboardInterrupt")
finally:
handle_cleanup()
代码运行器如何停止代码以及实现目标的选择是什么?
【问题讨论】:
-
尝试使用 ctrl+c
-
代码运行器不支持输入,我知道@JenilDave。
标签: python visual-studio-code vscode-code-runner