I've been looking for a tool that generates pretty HTML from Python (and most other programming languages) source code, that I can subsequently cut paste on Google Sites (this website).
There is a toolcreated by Oleg Parashchenko which works perfectly.
For example,
This source code:
class MyClass:
"""A simple example class"""
i = 12345
def f(self):
return 'hello world'
Becomes this color-coded easy-to-read HTML:
class MyClass: """A simple example class""" i = 12345 def f(self): return 'hello world'
So, how do we go about doing this?
Go to the website http://tohtml.com/
Choose the programming language
Paste your source code into the lower box (titled "Source Code")
Click the "Highlight button"
Copy the generated HTML code to the clipboard
On your Google Sites page in edit mode, click on "HTML" on the main menu
Paste the generated HTML code from the clipboard
Update: Actually, there is a quicker way. In step 5, just copy the generated HTML from the tohtml.com website and paste it into the usual edit screen of Google Sites (not HTML). The color coded syntax should carry over via the clipboard automatically.