From 8e1e5ab75277f9295510ac3b661c6fea92a15464 Mon Sep 17 00:00:00 2001 From: edbrz9 Date: Thu, 29 Dec 2022 13:05:15 +0100 Subject: [PATCH] ... --- proj/y2t/handler.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/proj/y2t/handler.php b/proj/y2t/handler.php index 1edd076..4b7de57 100644 --- a/proj/y2t/handler.php +++ b/proj/y2t/handler.php @@ -21,11 +21,16 @@ echo $lang; echo nl2br("\n"); - $output = exec("python3 y2t.py " . $ulr . " " . $lang, $output); - sleep(5); - echo $output; + // Open a pipe to the python script + $handle = popen("python3 y2t.py $url $lang", "r"); + while (!feof($handle)) { + $output = fread($handle, 1024); + echo $output; + } + $exitCode = pclose($handle); + echo nl2br("\n"); - echo "check" + echo "end of php"; ?>