简体   繁体   English

pdb 调试器在 reticulate::repl_python() 中不起作用

[英]pdb debugger doesn't work in reticulate::repl_python()

I try to debug my Python script within RStudio IDE using pdb package. The scripts looks the following:我尝试使用 pdb package 在 RStudio IDE 中调试我的 Python 脚本。脚本如下所示:

a=1 
breakpoint()
b= 2
c = 5
k = 10 

When i try to print some output (pa) in the console nothing happens.当我尝试在控制台中打印一些 output (pa) 时,没有任何反应。 If i quit the debugger using the command q the variable displays.如果我使用命令 q 退出调试器,则会显示变量。 Why the p command do not show any output within debugging mode?为什么 p 命令在调试模式下不显示任何 output?

I could also not find a native way to debug python code in RStudio, but used ipdb which is an iterative debugger for python我也找不到在 RStudio 中调试 python 代码的本机方法,但使用了 ipdb,它是 python 的迭代调试器

try:尝试:

import ipdb
ipdb.set_trace()

then run:然后运行:

python -m ipdb Run-Script.py

I followed this guide here: https://hasil-sharma.github.io/2017-05-13-python-ipdb/我在这里遵循了本指南: https://hasil-sharma.github.io/2017-05-13-python-ipdb/

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

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