tabel.py
by
admin
—
last modified
2007-07-05 09:39
http://www.eksperten.dk/spm/778800
Size 1 kB - File type text/python-sourceFile contents
#!/usr/bin/env python2.4
# -*- coding: UTF-8 -*-
import cherrypy
class tabel:
def tabel( self ):
return "<table>\n<tr>"+"</tr>\n<tr>".join( [ "".join( [ "<td>%d</td>" % ( x*z ) for x in range( 1,11 ) ] ) for z in range( 1,11 ) ] ) + "</tr></table>"
def index(self):
data = self.tabel()
return """
<html>
<head>
<style>
td { text-align: right; width: 10%%; }
</style>
</head>
<p><a href="http://www.databassen.dk:8090/bauerdata/tabel">Se kildekode</a></p>
<pre>
print "\\n".join(["".join([ "%%4d" %% (x*z) for x in range(1,11)]) for z in range(1,11)])
</pre>
%(data)s
</html>
""" % vars()
index.exposed = True
cherrypy.root = tabel()
if __name__ == '__main__':
cherrypy.config.update(file = 'tabel.conf')
cherrypy.server.start()
Click here to get the file