我找到了答案。
我需要测试这种远程调试器方法。在
让我解释一下我是怎么发现的:
我有一个使用python2.6.5的本地系统。
我用Python2.7.3创建了一个新的远程系统(本例中是虚拟机)。
然后我分享了以下脚本:import pydevd
print 'hello world'
# call debugger server to handle this breakpoint
pydevd.settrace('10.31.94.156', stdoutToServer=True, stderrToServer=True)
# fron now on the host (debugger server) has control over breakpoints,
# variables, stepping through code etc.
print 'hi again'
import sys
print sys.version # 2.7.3 (default, Sep 26 2013, 20:08:41)
# [GCC 4.6.3]
# now use a 2.7 feature:
x = {i : chr(65+i) for i in range(4)} # dict comprehension
print x # {0: 'A', 1: 'B', 2: 'C', 3: 'D'}
import socket
print socket.gethostname() # my virtual machine name
print 'done'
当然,我在Eclipse的主机上添加了一些断点。有趣的是,本地解释器给出了关于列表理解的错误,而实际上它是在运行的。它还有一个变量x,很好地显示在调试器变量窗格中。在
结论:远程解释器用于运行/评估代码。
调试器服务器帮助您