|
import pathlib
|
|
|
|
|
|
all_content = []
|
|
|
|
for file in pathlib.Path("logs_summaries").glob("*.txt"):
|
|
with open(file, "r") as f:
|
|
all_content.append(f.read())
|
|
|
|
with open("logs_summaries/merged.txt", "w") as f:
|
|
f.write("\n\n".join(all_content))
|
|
|
|
html_content = ['<html>',
|
|
"""
|
|
<style>
|
|
body {
|
|
width:100%;
|
|
}
|
|
img {
|
|
width:40%;
|
|
padding: 4%;
|
|
float:left;
|
|
}
|
|
</style>
|
|
""",
|
|
'<body>']
|
|
|
|
|
|
graph_images = list(pathlib.Path(".").glob("*.png"))
|
|
graph_images.sort(key=lambda graph: graph.name)
|
|
|
|
for graph_image in graph_images:
|
|
html_content.append(f'<img src="{graph_image}"></img>')
|
|
html_content.append("</body></html>")
|
|
|
|
with open("graphs.html", "w") as f:
|
|
f.write("\n".join(html_content))
|
|
|
|
print("graphs.html generated!")
|