From e6134f79f92310ad69bb4d42cdda5d9af6aa0733 Mon Sep 17 00:00:00 2001 From: Robbin Ploeger Date: Mon, 10 Jan 2022 15:34:00 +0100 Subject: [PATCH] Run python scripts in unbuffered mode --- src/Tasks/Python/RunScript.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Tasks/Python/RunScript.php b/src/Tasks/Python/RunScript.php index da16c51..688c2de 100644 --- a/src/Tasks/Python/RunScript.php +++ b/src/Tasks/Python/RunScript.php @@ -21,7 +21,9 @@ public function run() $path = $this->repository()->dir()->getPath($this->primaryFile); chdir($this->repository()->dir()->getPath()); - passthru("python $path"); // @todo does not work with pythons `input` function + + // -u is to prevent input calls from buffering until after the script is executed + passthru("python -u $path"); } public function message(): string