
hier mal mein versuch:
Code: Alles auswählen
import cherrypy
import sys
from simpletal import simpleTAL, simpleTALES
class HelloWorld(object):
def index(self):
context = simpleTALES.Context()
context.addGlobal ("title", "Hello World")
templateFile = open ("test.html", 'rt')
template = simpleTAL.compileHTMLTemplate (templateFile)
templateFile.close()
return template.expand(context, sys.stdout)
index.exposed = True
def asd(self):
return "asd"
asd.exposed = True
cherrypy.quickstart(HelloWorld(), '/', "myconfig.conf")
ist ja auch klar:
"return template.expand(context, sys.stdout)"
wie mache ich es nun, dass der html-code auch im browser angezeigt wird?
wie gesgat hab keine doku gefunden, wo die einzelnen funktionen erwähnt werden