Tuesday, September 23, 2008


I thought I'd mention the Pythonic syntax highlighter Pygments. It is a very powerful syntax highlighter written in Python. It has a nice API that can be used from Python applications as well as a nice command line utility. Here is some sample output from the Pygments command line:

class MyClass:
"""This is my class."""
def __init__(self):

def set_my_attr(self, my_attr):
"""Set the my_attr attribute."""

def get_my_attr(self):
"""Return the my_attr attribute."""
return self.my_attr

if __name__=='__main__':
print 'ATTR:', my_obj.get_my_attr()

This was actually printed to the console screen but can easily be captured in an HTML file.

No comments :

Post a Comment