Why don't you try pygments ?
Steps
Start your shell ( cmd if you are on windows)
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