Print results for all files :)
This commit is contained in:
parent
bec028d7a5
commit
94eab8036c
@ -29,8 +29,11 @@ def execute():
|
|||||||
"""
|
"""
|
||||||
Execute script and return output
|
Execute script and return output
|
||||||
"""
|
"""
|
||||||
|
def _file_stem(f):
|
||||||
|
return f[-5:]
|
||||||
|
|
||||||
os.chdir(Path("Python/"))
|
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 = [], []
|
timings, results = [], []
|
||||||
for script in scripts:
|
for script in scripts:
|
||||||
@ -41,7 +44,7 @@ def execute():
|
|||||||
writer = MarkdownTableWriter(
|
writer = MarkdownTableWriter(
|
||||||
table_name="Project Euler Solutions",
|
table_name="Project Euler Solutions",
|
||||||
headers=["Problem #", "Result", "Execution time (Python)"],
|
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=[
|
column_styles=[
|
||||||
Style(align="center"),
|
Style(align="center"),
|
||||||
Style(align="right", thousand_separator="_"),
|
Style(align="right", thousand_separator="_"),
|
||||||
@ -57,4 +60,5 @@ if __name__ == "__main__":
|
|||||||
md = read_md()
|
md = read_md()
|
||||||
# print(md)
|
# print(md)
|
||||||
res = execute()
|
res = execute()
|
||||||
write_md(res)
|
# print(res)
|
||||||
|
# write_md(res)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user