使用System()从R脚本调用Python命令

2024-04-19 11:58:22 发布

您现在位置:Python中文网/ 问答频道 /正文

在我的R脚本中,我必须执行一个外部Python脚本,并使用^{} function。在

system("python -m premailer -f daily-report.html -o
ready-weekly-report.html")

但是在R控制台中运行这个之后,我得到的是

enter image description here

^{pr2}$

如果我从终端运行python命令,一切正常。在

编辑


Tags: https命令reportgithub脚本终端编辑html
1条回答
网友
1楼 · 发布于 2024-04-19 11:58:22

我就是这样修好的。在

Adding the following line to the end of that file, showed me the correct path in Rstudio after restarting my R kernel:

.Internal(Sys.setenv("PATH", paste("/usr/local/bin", Sys.getenv("PATH"), sep=":")))

相关问题 更多 >