Skip to content
Snippets Groups Projects
Commit 88f83bcf authored by Michael Reuscher's avatar Michael Reuscher
Browse files

to simrunner add output for returncode and errors

parent 2d990982
No related branches found
No related tags found
1 merge request!4Python driver and data analysis part
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
"-N": "4"}, "-N": "4"},
"data_set_2":{ "data_set_2":{
"--posixDataDir": "protokoll", "--posixDataDir": "protokoll",
"-q": "20",
"-n": "20", "-n": "20",
"-s": "1M", "-s": "1M",
"-i": "0.1s", "-i": "0.1s",
......
...@@ -12,8 +12,10 @@ def read_config(): ...@@ -12,8 +12,10 @@ def read_config():
def start_process(program_path, arguments): def start_process(program_path, arguments):
command = [program_path] + arguments command = [program_path] + arguments
process = subprocess.run(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE) result = subprocess.run(command, capture_output=True, text=True)
return process output = result.stdout
errors = result.stderr
return output, errors, result.returncode
def set_arguments(data_config): def set_arguments(data_config):
...@@ -38,8 +40,11 @@ def run_sim(e_list, d_path, s_path): ...@@ -38,8 +40,11 @@ def run_sim(e_list, d_path, s_path):
os.makedirs(relativ_path, mode=0o777, exist_ok=True) os.makedirs(relativ_path, mode=0o777, exist_ok=True)
event[-1] = relativ_path event[-1] = relativ_path
arguments = event arguments = event
output = start_process(s_path, arguments) output, errors, return_code = start_process(s_path, arguments)
print(output) print(output)
print(errors)
if return_code > 0:
print(return_code)
# --- MAIN --- # --- MAIN ---
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment