问题
I'm following a pretty old guide where one could tell PyDev a script path from another application & it would debug it, line by line in eclipse. I like this method, instead of putting settrace()
breakpoints in the main script.
scriptpath = "Users/me/Desktop/script.py"
debuggerpath = "/Users/me/.p2/pool/plugins/org.python.pydev.core_7.5.0.202001101138/pysrc"
import pydev_debug as pydevd
pydevd.debug(scriptpath, debuggerpath, trace=True )
Most likely, the api has changed. What is the current method to do the same ?
回答1:
Well, I'm not sure which guide is this (I don't think there ever was a pydev_debug
in PyDev).
What that module probably did is add pydevd
to sys.path
and then setup the current tracing in using pydevd.settrace
and then called execfile
(in Python 2 -- for Python 3 the exec is a bit more contrived... see: https://github.com/fabioz/PyDev.Debugger/blob/master/_pydev_imps/_pydev_execfile.py)
So, although there's no ready made solution for that, it should be relatively easy to do with the building blocks provided by PyDev.
来源:https://stackoverflow.com/questions/60570669/how-to-send-a-script-path-in-pydev-for-debugging-instead-of-inserting-settrace-i