Call python script from ruby

前端 未结 5 1554
一整个雨季
一整个雨季 2020-12-14 20:40

For example, I can use Python scripts in PHP like there:

exec(\"python script.py params\",$result);

where \"script.py\" - script name and v

5条回答
  •  有刺的猬
    2020-12-14 21:07

    You can use backticks to accomplish this in two ways

    result = `python script.py params`
    

    or

    result = %(python script.py params)
    

提交回复
热议问题