I have a Python program that has multiple print statements in it. When I execute the program from PHP, the output displayed is just the value printed by the last print statement. Is there a way to capture values printed by all the print statements in the Python script?
PHP code:
<?php
ini_set('display_errors', 1);
$output = exec("python script.py");
echo $output;
?>