How to make web pages with images automatically with Python

from glob import glob
import os
import sys

'''
	Takes all the png and create a web page
	that displays all the images centered
	with a black background

'''


images = glob("*.png")
html = "<style>body{color:white;background:black}</style>"
for i in images:
	html += f"<center><img src='{i}'><br></center>"
with open("file.html", "w") as file:
	file.write(html)
os.system("file.html")
sys.exit()

Subscribe to the newsletter for updates
Tkinter templates
Avatar My youtube channel

Twitter: @pythonprogrammi - python_pygame

Videos

Speech recognition game

Pygame's Platform Game

Other Pygame's posts

Published by pythonprogramming

Started with basic on the spectrum, loved javascript in the 90ies and python in the 2000, now I am back with python, still making some javascript stuff when needed.