LJ Archive

Listing 1. helloworld.py, a Simple Zope Product

class helloworld:
  "This is a sample Zope product,
   the class 'helloworld'"

  meta_type = "helloworld"

  def __init__(self):
     "This method is invoked when a new instance of
      helloworld is created"
     self.id = id

  def index_html(self):
     "This method is invoked by default in a folder"
     return """<html>
     <head>
     <title>Hello, world!</title>
     <body>
     <h1>Hello, world!</h1>
     <p>This is output from our simple Python product</p>
     </body>"""
LJ Archive