From e4903fc07dfe8d8e5b2a8a25964eb07a8cf9674d Mon Sep 17 00:00:00 2001 From: Hong-Phuc Bui <hong-phuc.bui@htwsaar.de> Date: Mon, 27 May 2024 17:24:10 +0200 Subject: [PATCH] dms --- funktion-modular/study-effort/effort_semester.py | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/funktion-modular/study-effort/effort_semester.py b/funktion-modular/study-effort/effort_semester.py index 24bca67..ecc3570 100644 --- a/funktion-modular/study-effort/effort_semester.py +++ b/funktion-modular/study-effort/effort_semester.py @@ -43,7 +43,7 @@ with open(lecture_filename) as file: while line := file.readline(): line = line.strip() - if line[0] != '#': + if len(line) > 0 and line[0] != '#': line = parse_line(line) lectures.append( line ) return lectures @@ -65,7 +65,7 @@ def print_effort(effort: list[tuple[str, float, float, float]]) -> None: header = ("Vorlesung", "ECTS", "V;U;T/Woche", "Aufwand/Woche") max_char = len(header) - sep_width = 3 + sep_width = 0 sum_effort = 0 for l in effort: if (c := len(l[0])) > max_char: @@ -94,9 +94,7 @@ if __name__ == "__main__": lecture_filename = sys.argv[1] lectures = collect_lectures_from_file(lecture_filename) - print(lectures) effort = compute_semester_effort(lectures) - #print(effort) print_effort(effort) -- Gitblit v1.10.0-SNAPSHOT