简体   繁体   English

如何以交互方式调试python vim脚本?

[英]How can I interactively debug a python vim script?

I have a vim plugin that I'm writing in python, however I need to debug the python script. 我有一个vim插件,我正在用python编写,但是我需要调试python脚本。 How can use pdb (or preferably ipdb) in the vim script itself? 如何在vim脚本本身中使用pdb(或最好是ipdb)? When I use pdb vim just hangs with no output, and when I use ipdb it turns vim into garbaged output. 当我使用pdb vim时挂起没有输出,当我使用ipdb时,它将vim转换为garbaged输出。

You could try rpdb to debug remotely. 您可以尝试使用rpdb进行远程调试。 Where the remote is just a different tab in your shell. 远程只是shell中的不同选项卡。

Just install Winpdb (not windows specific anymore) http://winpdb.org/ It includes rpdb2 which is a remote version of pdb and winpdb itself is a nice graphical debugger. 只需安装Winpdb (不再是Windows特定的) http://winpdb.org/它包括rpdb2 ,它是pdb的远程版本, winpdb本身是一个不错的图形化调试器。

Usage example with Winpdb: Winpdb的用法示例:

import rpdb2
rpdb2.start_embedded_debugger('some password')

And from Winpdb: 从Winpdb:

File -> Attach

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM