From e60bacf7100db97d11d1f10d3cdf4f769c5e69b6 Mon Sep 17 00:00:00 2001 From: Pascal Lais Date: Fri, 10 Dec 2021 08:54:58 +0100 Subject: [PATCH] Update run_all.py Fix printing total run time. --- run_all.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/run_all.py b/run_all.py index 3d86edd..185c400 100644 --- a/run_all.py +++ b/run_all.py @@ -5,11 +5,11 @@ from os.path import isdir, isfile from subprocess import Popen, PIPE, CalledProcessError from time import time - +total_run_time = 0 for dir in [x for x in sorted(listdir('.')) if isdir(x)]: file = dir + '/' + dir + '.py' input = dir + '/input.txt' - total_run_time = 0 + if isfile(file) and isfile(input): print('--------------------------------') print(dir, ':', sep='') @@ -23,5 +23,5 @@ for dir in [x for x in sorted(listdir('.')) if isdir(x)]: run_time = end_time-start_time total_run_time += run_time print(f'Runtime: {run_time:.2f} s') - print('--------------------------------') - print(f'Runtime: {total_run_time:.2f} s') +print('--------------------------------') +print(f'Runtime: {total_run_time:.2f} s')