Question

Is there a way to publish Python code into a blog?

For instance, are there any plugins for Eclipse or Emacs that can be used to format or transform the code into HTML snippets for blogger?

I stumbled across this question but there is no reference to Python and i was wondering if this is doable and how.

There is this on-line source code formatter for blogger though i am not sure if it highlights python code properly..

any thoughts?

Appreciate all the good help.

Was it helpful?

Solution

Why don't you try pygments ?

http://pygments.org/

Steps

  1. Start your shell ( cmd if you are on windows)

  2. Run : 'easy_install pygments' and wait

You can use this

pygmentize -f html -O full -o file.html file.py

-O full tells pygmentize to generate a complete HTML document

-o tells pygmentize to output the HTMl code to file.html

OTHER TIPS

Looks like IPython notebook has a utility for this: nbconvert

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top