我在将base64编码的图像字符串传递给python脚本时遇到错误....那无法运行shell_execute(“ python hello.py $ data”)这是我的代码
php文件
<?php
echo "Good Work";
$img = file_get_contents("aaaa.jpg");
$data = base64_encode($img);
$output = shell_exec("python hello.py".$data);
echo $output;
?>
hello.py文件
import sys
import base64
image_64_encode=sys.argv[1]
with open("image.jpg","wb") as fh:
fh.write(base64.decodebytes(image_64_encode))`