diff --git a/src/update_results_table.py b/src/update_results_table.py index 8c36dab..5cbf8b6 100644 --- a/src/update_results_table.py +++ b/src/update_results_table.py @@ -29,8 +29,11 @@ def execute(): """ Execute script and return output """ + def _file_stem(f): + return f[-5:] + os.chdir(Path("Python/")) - scripts = sorted(glob("*[0-9].py")) + scripts = sorted([script.as_posix() for script in Path(".").rglob("*[0-9].py")], key=_file_stem) timings, results = [], [] for script in scripts: @@ -41,7 +44,7 @@ def execute(): writer = MarkdownTableWriter( table_name="Project Euler Solutions", headers=["Problem #", "Result", "Execution time (Python)"], - value_matrix=[[int(t[25:27]), int(r[23:]), t[29:]] for t,r in zip(timings, results)], + value_matrix=[[f"{int(t[26:28]):003d}", int(r[23:]), t[29:]] for t,r in zip(timings, results)], column_styles=[ Style(align="center"), Style(align="right", thousand_separator="_"), @@ -57,4 +60,5 @@ if __name__ == "__main__": md = read_md() # print(md) res = execute() - write_md(res) + # print(res) + # write_md(res)