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:
<-- --> |