Python is famous to let automate things in few lines of code and now we will demonstrate it. Here is a simple script that lets you create a page in a second (or less). Just put the images in a folder in a progressive numbered name (if you need to have then in order) and then launch the script in the folder. You will have your page ready to be shown to the World.
This is the whole code:
import os import glob html = "" for file in glob.glob("*.png"): html += f"<img src='{file}'/><br>" with open("index.html", "w") as outputfile: outputfile.write(html) os.startfile("index.html")
Live coding video, making an html presentation file in seconds
A nicer ‘look’ to the page, centered and ‘stretched’
I made some changes to make each image fit the screen.
import os import glob html = "" for file in glob.glob("*.png"): html += f"<center><img src='{file}'/ height=100%></center><br>" with open("index.html", "w") as outputfile: outputfile.write(html) os.startfile("index.html")
Using pathlib
This is a version made with pathlib
import pathlib import os html = "" for file in pathlib.Path(".").iterdir(): if file.is_file(): if str(file).endswith(".PNG"): html += f"<center><img src='{file}'/ height=100%></center><br>" with open("index2.html", "w") as outputfile: outputfile.write(html) os.startfile("index2.html")