XD blog

blog page

html, python, tips


2013-03-12 Convert a Python script into a HTML file

This blog shows many Python script in HTML files with colors. I use the following module to do that: py2html. Well, I downloaded a few years ago and it does not seem to be available anymore. I modified to make it work on Python 3. I also created a second file on the top of it to add other stuff (footer, ...). You can find them here:

Plus, copy/pasting does preserve indentation which I do appreciate.


<-- -->

Xavier Dupré