【发布时间】:2014-12-05 11:20:36
【问题描述】:
我正在尝试从 php webapp 读取 python 输出。
我在 php 代码中使用 $out = shell_exec("./mytest") 来启动应用程序,并在 python 应用程序中使用 sys.exit("returnvalue") 来返回值。
问题是$out 不包含我的返回值。
相反,如果我尝试使用$out = shell_exec("ls"),$out 变量包含ls 命令的输出。
如果我从终端运行./mytest,它可以工作,我可以在终端上看到输出。
【问题讨论】:
标签: php python shell-exec