我有一个Python函数如下:
请问“reticulate”软件包是否有此功能?
def function_name(args):
def print_hello():
print("hello")
不需要将内容写入Python文件并使用source_python
从文件中读取。我想直接将函数作为字符串传递并转换为R语言。
类似于以下的方法:
library(reticulate)
myPythonFunction <- "def print_hello():
print("hello")
"
source_from_string(myPythonFunction)
print_hello()
请问“reticulate”软件包是否有此功能?