Running Rscript via Python using os.system() or subprocess()

后端 未结 2 1222
长情又很酷
长情又很酷 2021-01-28 18:24

I am facing problems running a Rscript via Python using os.system() or subprocess().

Using os.system() to run commands via python works generally fine for me (e.g. with

2条回答
  •  暖寄归人
    2021-01-28 18:48

    After getting mental on such a simple problem. I decided to reinstall RStatistics to a path with no spaces or points, like: C:/R/bin/Rscript.exe.

    Now subprocess.call(["C:/R/bin/Rscript.exe", "D:/otsu_Script.R"] ) or os.system("C:/R/bin/Rscript.exe D:/otsu_Script.R") are working just fine. Should have tried it two days ago...

    ... but now I am a happy monkey anyway :-)

提交回复
热议问题