def classToFile(className):
    """save html class representation to file <className>.html."""
    global classSaved
    if className not in classSaved:
        print '    creating %s.html' % className
        packageName = Class.getPackage(Class.forName(className)).getName()
        packageLnk = '<a href="%s.html">%s</a>' % (packageName, packageName)
        htmlClass = '    <h1>Class <b>%s</b> from package %s</h1>' % \
                    (className, packageLnk)
        htmlClass += '\n' + javaClassToHtml(className)
        htmlContent = baseHtml(className, htmlClass)
        toFile('%s.html' % className, htmlContent)
        classSaved += [className]
    else:
        print '    file %s.html was writen allready' % (className)
save html class representation to file <className>.html.
recipes/Python/502222_Creating_javclass/recipe-502222.py