小编use*_*027的帖子

是否有一个与R的invisible()函数等效的Python

我是Python的新手,想知道Python(或IPython)是否与R中的invisible()函数等效。invisible()函数返回值,但如果以交互方式运行,则不显示它们,而是仅使它们可用进行分配。例如:

doStuff <- function(x) {
   // blah blah 
   return(invisible(retValue))
}

z = doStuff(x) // z has the return value
doStuff(x) // retValue doesn't get displayed
Run Code Online (Sandbox Code Playgroud)

python r ipython

6
推荐指数
1
解决办法
692
查看次数

标签 统计

ipython ×1

python ×1

r ×1