Home > The Snail Log > Snail's Microblog > 02 Jan 2022

python-1

ok ok so I touched on it in the changelog, but today I woke up and went “hmm. let’s get rid of the javascript on my comic pages.”

but the trouble with this is that the HTML alternative is to create individual .html files for each page of each comic. and I have a lot of comics on this site- factory town alone has 57 pages!! I did not want to edit all these by hand.

luckily for me, I remembered that I know Python! so I decided some automation was in order.

I haven’t programmed anything in like at least two years though?

it took a little trial and error, but in the end I came up with a script that looped through all of the comic images and created a HTML page for each one, adding the correct first/prev/next/last links and other info into a template file using .replace()

it’s not perfect and I still had to edit some things manually, but it definately saved some time and was much more entertaining than writing all the .html files by hand would’ve been.

anyways now I wanna program some more because I’d forgotten how fun it is!!