admin管理员组文章数量:1289877
So I have a python app that reads/loads a file that is sort of like a plugin for the main application.
I would really like to be able to debug (step into) the code from VSCODE - which I'm using as an IDE
I've tried a number of things, described here (and related posts)
How to debug python code running inside exec()
These are not working.. I do end up in the pub shell in the terminal window, but that is not really what I was hoping for.
Why? What I have is a large directory (forest) of various data directories. Each subdirectory contains a body of data, and I want to have a "customization script" - that I can execute for that subdirectory. Sort of like a PLUGIN of sorts
So I get to the point where I have the name of the file, I can read the file and I want to "exec()" the contents (string) of that file, and I really want to step into the script being executed.
how can I do this?
EDIT: jan-13 I was asked for an minimally reproducible example, so I am adding one.
# Normally this code would come from a file I open and read
# In this example I have it as a multi-line string.
code='''
for x in range(0,100):
print("Hello %d" % x)
'''
# I want to step into the above code using some IDE (ANY IDE)
# I currently use VSCODE but another is just as good.
exec( code )
Launch the above in an IDE and try to step through the 'code'
本文标签: vscodepythonstep through code being 39exec39edStack Overflow
版权声明:本文标题:vscode, python - step through code being 'exec'ed - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1737520652a1994154.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论