Translate PrintToHTML.py to Python3