From aa42982df46342541872160227c201012f41af2c Mon Sep 17 00:00:00 2001 From: Padam ghimire Date: Wed, 24 Apr 2024 21:48:03 +0545 Subject: [PATCH] fix/output directory generation not working as expected. --- school_center.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/school_center.py b/school_center.py index 271e2f0..9140f8f 100644 --- a/school_center.py +++ b/school_center.py @@ -207,8 +207,8 @@ def is_allocated(scode1: str, scode2: str) -> bool: OUTPUT_DIR = 'results/' create_dir(OUTPUT_DIR) # Create the output directory if not exists -with open('{}school-center-distance.tsv'.format(OUTPUT_DIR), 'w', encoding='utf-8') as intermediate_file, \ - open(OUTPUT_DIR + args.output, 'w', encoding='utf-8') as a_file: +with open(os.path.join(OUTPUT_DIR, 'school-center-distance.tsv'), 'w', encoding='utf-8') as intermediate_file, \ + open(os.path.join(OUTPUT_DIR, args.output), 'w', encoding='utf-8') as a_file: writer = csv.writer(intermediate_file, delimiter="\t") writer.writerow(["scode", "s_count",