From 30b8a69c947765f9721b46f169bbe3d4e46f2fc9 Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Fri, 5 Aug 2022 18:29:52 +0000 Subject: [PATCH] Execute script and wait for it to complete Co-authored-by: sigonasr2 --- ArcadeReader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ArcadeReader.java b/ArcadeReader.java index b6857cc..893bc25 100644 --- a/ArcadeReader.java +++ b/ArcadeReader.java @@ -97,7 +97,8 @@ abstract class Reader{ List readRegions = new ArrayList<>(); String readAllBoxes() { try { - Process p = Runtime.getRuntime().exec("cat testBoxes.txt"); + Process p = Runtime.getRuntime().exec(new String[]{"python3","runocr.py","ja"}); + while (p.isAlive()); InputStreamReader result = new InputStreamReader(p.getInputStream()); StringBuilder sb = new StringBuilder(); while (result.ready()) {