Py2Html - A MS Windows version of nice pygments python script.

postado em 24 de abr de 2013 09:59 por Marco Aurelio Zoqui   [ 18 de ago de 2015 07:43 atualizado‎(s)‎ ]
The py2html is a very simple MS Windows executable file that highlights your python code in nice HTML files. 
It make use of the pygment modules to highlight the code, but you don't need to install the pygment or have python interpreter installed. 

The pygmentize python (unix like script) was converted in py2html.exe by py2exe (thanks http://www.py2exe.org)
therefore all options applicable to pygmentize is also applicable to py2html

Compare the linux pygmentize statement and MS Windows py2html.exe version:

linux pygmentize command line for a html div:

$pygmentize -f html -o test.html test.py


MS Windows py2html command line for a html div:

py2html -f html -o test.html test.py

yeah, sounds good, uh?!

Please, try out some of the following combinations:

 

Generating the complete html code:

       py2html -f html -O style=colorful,linenos=1 -l python test.py

       py2html -O full,style=emacs -o setup.html setup.py

  

Generating a stylesheet (css) to be included in your html file

       py2html -f html -S colorful -a .syntax

See more examples at:


more scripts:

  • Database Conversion Tools:

    download file: SqlServer PostgreSQL Conversion Tools.zip

    Usage:
    • PostgreSQL to SQL Server database conversion
      cscript pg2ms.vbs

    • SQL Server to PostgreSQL database conversion
      cscript ms2pg.vbs



Now that you are ready to download it




Many thanks to: 
  • Georg Brand and Armin Ronacher - Pygments is the best
  • Thomas Heller, Jimmy Retzlaff, Mark Hammond - py2exe is unique!!!
Greetings
marco A zoqui