How to paste python code on wordpress?

chris.atlee at gmail.com chris.atlee at gmail.com
Tue Nov 22 09:18:56 EST 2005


If you're using vim [1] as your editor, or even if you have it
installed, you can make use of the 2html.vim script [2] to convert your
python code to HTML complete with syntax highlighting.

In vim, try running:
:run! syntax/2html.vim

If you don't want to run vim as your editor, but just want to convert a
file to HTML, you can try something like:
gvim -f +"syn on" +"run! syntax/2html.vim" +"wq" +"q" mypython.py

Cheers,
Chris

[1] http://www.vim.org
[2] http://vimdoc.sourceforge.net/htmldoc/syntax.html#2html.vim




More information about the Python-list mailing list