最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

debugging - How to debug Python functions in Rstudio? - Stack Overflow

programmeradmin8浏览0评论

I have Python chunks in an Rmd file in Rstudio that I would like to debug.

I am using ipdb but when it gets to the breakpoint in the function it doesn't open a separate terminal as I was expecting from the ipdb examples online; instead the console prompt just switches to ipdb.

I can interogate variable values and step thru the code but it is very difficult to work out which line I am on (in the examples online about ipdb when the code opens in a seperate window the current line is indicated by an arrow which updates as you step through the code).

```{python}
import ipdb

def test(x):
  ipdb.set_trace() #ipdb breakpoint
  y=x*3
  z=y+4
  return z

 test(3)
```

Any suggestions for how to get ipdb to work properly within Rstudio or a Python debugger that is compatible with Rstudio would be great.

发布评论

评论列表(0)

  1. 暂无评论