diff --git a/src/update_results_table.py b/src/update_results_table.py index 94a84dc..7a2a965 100644 --- a/src/update_results_table.py +++ b/src/update_results_table.py @@ -2,4 +2,38 @@ def update_table(): """ Update README.md with the timings of the solved problems """ + text = read() + print(text) + +def read(): + """ + Read README.md + """ + with open("../README.md", "r") as f: + text = [line.strip() for line in f.readlines() if line.strip() != ""] + return text[-1:] + +def write(): + """ + Write to README.md + """ pass + +def execute(num): + """ + Execute script and return output + """ + import sys + sys.path.insert(0, "./Python/") + + import Problem001 + + res = eval(f"Problem{num:0>3}.compute()") + print(res) + time = str(res).split(sep=" ") + print(time) + + +if __name__ == "__main__": + # update_table() + execute(1) \ No newline at end of file