From 1c2739985d8bd26fc7285f00a54a045977802ec3 Mon Sep 17 00:00:00 2001 From: Greg Foss Date: Wed, 11 Mar 2020 15:51:56 -0400 Subject: [PATCH] Adding pause on complete to start bfs script --- bfs/scripts/log.txt | 68 +++++++++++++++++++++++++++++++++++++++++ bfs/scripts/startbfs.py | 14 ++------- 2 files changed, 71 insertions(+), 11 deletions(-) diff --git a/bfs/scripts/log.txt b/bfs/scripts/log.txt index f4c958c..2c3741a 100644 --- a/bfs/scripts/log.txt +++ b/bfs/scripts/log.txt @@ -59,3 +59,71 @@ Could not acquire mutex to add new client thread Listening for clients... Hello new client! Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... +Could not acquire mutex to add new client thread +Listening for clients... +Hello new client! +Listening for clients... diff --git a/bfs/scripts/startbfs.py b/bfs/scripts/startbfs.py index 427cec5..c2f168e 100644 --- a/bfs/scripts/startbfs.py +++ b/bfs/scripts/startbfs.py @@ -12,7 +12,9 @@ def start_program(program): if not isinstance(program, str): raise ValueError("Argument passed to start_program_sync() should be a string") - return os.system("START /wait \""+ program +"\" CMD /c " + program) + command = "START /wait \"\" CMD /c \"" + program + "&pause\"" + print("> " + command) + return os.system(command) def start_program_async(program): @@ -74,16 +76,6 @@ def main(): exe_ending = ".exe" exe_names = get_exe_names(args.algorithm, args.io_processor, args.config) procs = [start_program_async(os.path.join(binary_path, x) + exe_ending) for x in exe_names] - - try: - while True: - user_in = input() - if user_in == "q": - print("Quitting prompt") - [proc.terminate() for proc in procs] - break - except Exception as e: - print("Python exception: [%s]" % str(e)) [proc.join() for proc in procs]