【问题标题】:What is the fastest way to execute Python from PHP?从 PHP 执行 Python 的最快方法是什么?
【发布时间】:2013-05-22 00:07:15
【问题描述】:

假设我需要将变量传递给 Python 脚本并从中获取结果,从 PHP 执行 Python 的最快方法是什么?

【问题讨论】:

标签: php python shell


【解决方案1】:

通过使用 popen() 函数:

$result = popen('python yourscript.py ' . $args, 'r');

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-04-16
    • 1970-01-01
    • 2011-04-23
    • 2021-10-17
    • 2019-01-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多