我正在尝试从PHP运行Python脚本。我已经尝试过使用:system()、exec()和shell\u exec()函数。现在我的PHP看起来像:
<?php
system('./main.py');
echo 'succes';
?>
我在Python脚本中创建了一些print()函数,发现它停在这一行:
QueryImgBGR = cv2.imread(image_path)
PHPecho()正在工作,但是system()函数没有结束。正在从控制台运行Python脚本
我正在使用python3.5.3(使用numpy、cv2和os库)和php7.2.4(system()、shell_exec()、exec()函数解锁)开发Debian 4.9.30
编辑:Python中的Someway print()函数在新行上打印,但system()函数在一行空间中打印所有内容
system()调用只提供命令输出的最后一行,它是调用的返回值。所以你想抓住它
相关问题 更多 >
编程相关推荐