When i use the below code, i get the proper values in php variables $f and $v when i exectute the code from console but when i execute the code from browser i don't get any value in php variables exec('python /var/www/abc/abc.py', $f, $v); echo $f; echo $retval;在python脚本中:我有类似的东西In python script: I have something like this code... code... ...... #in the end print text sys.stdout.flush()如何在php变量中获取python脚本中的打印值?How can i get the print values in python script in my php variables??推荐答案在调用exec()之前,确保$f是一个数组,然后print_r($f)应该可以解决问题Make sure $f is an array before calling exec(), then print_r($f) should do the trick 这篇关于如何在php脚本中的php变量中获取python脚本中的打印值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-03 19:48