I am using shell_exec to run python in php on MacOS
$result = shell_exec('/Users..../python parser.py '.$number.'/'.$newFileName);
php code doesn't wait until python code ends so there is no value in $result and it makes error. how can make php wait until python code ends?