From fdb1609a41a8282bedc9274d4c1248d2d6419c90 Mon Sep 17 00:00:00 2001 From: Ivan Usov Date: Tue, 6 Apr 2021 11:27:13 +0200 Subject: [PATCH] Print the content of spind result file --- pyzebra/app/panel_spind.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pyzebra/app/panel_spind.py b/pyzebra/app/panel_spind.py index b93135b..3e637d8 100644 --- a/pyzebra/app/panel_spind.py +++ b/pyzebra/app/panel_spind.py @@ -68,7 +68,7 @@ def create(): diff_vec = prepare_event_file(temp_event_file, roi_dict, path_prefix_textinput.value) - print(f"Content of {temp_event_file} file:") + print(f"Content of {temp_event_file}:") with open(temp_event_file) as f: print(f.read()) @@ -100,8 +100,9 @@ def create(): print(" ".join(comp_proc.args)) print(comp_proc.stdout) + spind_out_file = os.path.join(temp_dir, "spind.txt") try: - with open(os.path.join(temp_dir, "spind.txt")) as f_out: + with open(spind_out_file) as f_out: spind_res = defaultdict(list) for line in f_out: c1, c2, c3, c4, c5, *c_rest = line.split() @@ -119,6 +120,10 @@ def create(): results_table_source.data.update(spind_res) + print(f"Content of {spind_out_file}:") + with open(spind_out_file) as f: + print(f.read()) + except FileNotFoundError: print("No results from spind")