如何在 vim 中停止调试 python

How to stop debugging python in vim

这是我第一次在 vim 中编辑 python 代码,配备 python-mode 插件。设置断点后,我使用“\ r”命令 运行 it.Then 它在打印'[pymode]code 运行ning ...'后保持静止。我尝试了一些方法但仍然可以不退出debug.It就是不管我做什么都没有反应

根据官方调试器命令(来自here):

[usage:] dbg command [options]
- quit    :: exit the debugger
- run     :: continue execution until a breakpoint is reached or the program ends
         default shortcut: \r
- stop    :: exit the debugger
- over    :: step over next function call
         default shortcut: \o
- watch   :: execute watch functions
         default shortcut: \w
- up      :: go up the stack
         default shortcut: \u
- here    :: continue execution until the cursor (tmp breakpoint)
         default shortcut: \h
- down    :: go down the stack
         default shortcut: \d
- exit    :: exit the debugger
- eval    :: eval some code
- break   :: set a breakpoint
         default shortcut: \b
- into    :: step into next function call
         default shortcut: \i
- out     :: step out of current function call
         default shortcut: \t

使用 :!python3 %,而不是使用 :PymodeRun 或默认键绑定 <leader>r。这样你就可以 运行 shell 中的代码并且可以中断它并按预期使用调试器。